aboutsummaryrefslogtreecommitdiff
path: root/data/core/rootview.lua
AgeCommit message (Collapse)Author
2022-06-07initial documentation for better code completionjgmdev
2022-04-28Send `mouseleft` event when the mouse leaves the window (#928)Guldoman
* Send `mouseleft` event when the mouse leaves the window * Call `View:on_mouse_left` when the mouse leaves the `View` Previously `View:on_mouse_left` was called only when the mouse left the window, and it was called on every visible `View`. Now it gets also called when the mouse "changes" `View`, and only the last `View` the mouse was on will receive the event.
2022-04-25Add animation categories to enable finer transitions control (#941)Guldoman
* Allow finer control over transitions * Add categories to transitions
2022-03-18Merge pull request #755 from Jipok/draw_tab_reworkJefferson González
rootview.lua: Refactor Node:draw_tab
2022-02-15Allow intercepting `filedropped` eventsGuldoman
The event is first sent to the underlying `View`; if not handled, it's managed as before.
2022-02-09Fix cases of nil node.jgmdev
2021-12-21rootview.lua: Refactor Node:draw_tabJipok
2021-12-06Split `Node` and `EmptyView` from `RootView`Guldoman
2021-11-27Merge pull request #693 from adamharrison/fix-scrollbar-splitAdam
Added in check to make sure you can use a scrollbar on a split.
2021-11-23Fixed event propogation.Adam Harrison
2021-11-23Added in check to make sure you can use a scrollbar on a split.Adam Harrison
2021-11-23Manual merge of into .Adam Harrison
2021-11-16Fixed predicate and minor propogation issue.Adam Harrison
2021-11-14Rearranged things to make a bit more sense.Adam Harrison
2021-11-14Fixed propogation again.Adam Harrison
2021-11-14Propogated mouse clicks correctly.Adam Harrison
2021-10-23Select a new primary node when closing the current oneGuldoman
The new primary node can be any non-locked leaf node that isn't already primary.
2021-10-21Fix problem with treeview keeping the editor busyFrancesco Abbate
Fix a problem introduced when fixing the dirty pixel problem, commit cb08c5c. The node, when determining the layout was rounding the size of the fixed-size view. In turns this latter was calling move_towards to the default_size it wanted. If default_size was non-integer the value vas never archieved because it was rounded during layout and move_towars was keeping the editor busy by setting the core.need_redraw flag.
2021-10-11Correct Node's clipping rectangleFrancesco Abbate
Fixing the Node's clipping rectangle make the clipping in DocView:draw() partially redundant. This latter is now no longer needed to clip on the right when drawing the document's lines but it still serves to the purpose of clipping on the left, before the gutter region.
2021-10-10Use rounded value for node's size when splittingFrancesco Abbate
Rouding node's size to an integer value ensure drawing are pixel perfect in sizing.
2021-10-10Fix dirty pixels problem on window's right sideFrancesco Abbate
The last column of pixel on the window's right side isn't correctly drawn and pixels appear dirty and more noticeably when the a NagView message was previously shown, a stripe of red pixels remains on the right. We use now a more souding roundig scheme. Now the rectangles to clip or to draw are passed around as Lua numbers without any rounding. In turns, when the rect coordinates are passed to the renderer we ensure the border of the rect are correctly snapped to the pixel's grid. It works by computing the coordinates of the edges, round them to integers and then compute the rect's width based on the rounded coordinates values.
2021-10-02Force showing tabs when dragging themGuldoman
2021-10-02Implement tab drag and dropGuldoman
2021-10-02Move single tab drawing to its own functionGuldoman
2021-09-17Force showing tabs when dragging themGuldoman
2021-09-17Implement tab drag and dropGuldoman
2021-09-17Move single tab drawing to its own functionGuldoman
2021-09-15Fix wrong locked sibling checkGuldoman
Previously if the split type was "hsplit", but `locked_size_x` was falsy, `locked_size_y` was wrongly used.
2021-09-15Ensure that the primary node always has a `View`Guldoman
2021-09-15Only check if sibling is locked in the split directionGuldoman
If the sibling is not locked in the direction of the split, it should fill the space.
2021-09-15Fix checking if sibling is locked when removing `View`sGuldoman
We only checked if sibling was locked in the `x` direction.
2021-08-28Merge remote-tracking branch 'origin/fix-2.0.1'Francesco Abbate
2021-08-27Introduce View objects context propertyFrancesco Abbate
Used to determine if an instance of the given class should be closed or not when a project session is terminated.
2021-08-27Revert "Further simplifies logic for active view in close-all command"Francesco Abbate
This reverts commit bb6b99b16777f0b34c1ea28db78525b4041d0f31.
2021-08-27Allow tabs to always be visibleGuldoman
2021-08-27Further simplifies logic for active view in close-all commandFrancesco Abbate
2021-08-27Simplify commit daf91676 about active view settingFrancesco Abbate
2021-08-27Fix bug with close-all commandFrancesco Abbate
There are really multiple things here in the close_all_docviews function: 1. we reset the Node's tab_offset 2. we ensure the core's active_view is properly set 3. we close LogViews as well as DocViews Some conditions seems to never happen but we stay safe and try to cover all possible cases.
2021-08-10keep_inactive -> keep_activeAdam Harrison
2021-08-10Added in close others, and refactored close all.Adam Harrison
2021-08-06Fix inactive divider intercepting mouse clicksFrancesco Abbate
In the function Node:get_divider_overlapping_point() we check if we hit a divider (separator between two nodes). If yes the event is intercepted and used to set the cursor and drag the separator if appropriate. In reality, on mouse move events, when one of the node is a split and one of its child is not resizable we don't set the cursor to and we don't intercept the event. However on a mouse pressed event the event was intercepted regardless of the fact that the child nodes are resizable or not. This latter behavior was unwanted as it prevents mouse clicks to be processed because of a divided that is inactive. In addition it prevented processing of mouse clicks when the child node was invisible leading to issue #363. For this latter the issue was the invisible NagView in the upper part of the window. To fix the problem we provide a divider with Node:get_divider_overlapping_point() only if its child node are resizable. In this way the mouse clicks or movements are intercepted only if the divider is actually active.
2021-06-27Added in checks so that the entire thing isn't consumed.Adam Harrison
2021-06-27Created an extra command, to implement appropriat cmd+w behaviour on mac.Adam Harrison
2021-06-17clicking the empty space where the x was no longer closes the tabcukmekerb
2021-06-17added config.tab_close_button option to hide X on tabscukmekerb
2021-06-17Do not duplicate RootView method in contextmenuFrancesco Abbate
The method RootView:on_mouse_pressed was copied in the contextmenu plugin with a small modification to intercept the mouse clicks of the active view. This approach is problematic because a relatively large portion of code is duplicated. We introduced a function named RootView.on_view_mouse_pressed to let plugins like contextmenu intercepts mouse clicks in the active area without duplicating the function RootView:on_mouse_pressed.
2021-06-12Added a check for duplicate tabs, also ensured that the appropriate view is ↵Adam Harrison
set as active.
2021-06-12Added in some more checks.Adam Harrison
2021-06-12Allows you to drag nodes around splits.Adam Harrison
2021-06-03Scale fonts context menu (#246)Francesco
* Retrieve scale plugin from lite-plugins * New implementation of scale plugin and font C API Introduce two new C API functions, renderer.font.get_size and set_size respectively to get the font size and to set the size to a new value. Using these functions we don't need to know the name of the font but we can just change their size. Adapt the scale plugin to use the new C API function with minor adaptations in the logic. Use smaller step to scale fonts. Rename font_desc_free function, previous name was misleading as only the cached resources are freed. * Add contextmenu plugin from takase From https://github.com/takase1121/lite-contextmenu Adapted to show font scaling commands and find/replace commands. i# testing.lua * Fix the cursor flickering with contextmenu To avoid flickering of the cursor when using the context menu we add a new function `core.request_cursor` that just take note of the cursor requested. The cursor will be actually changed only in root_view:draw() method only when all the drawing operations are done. This means the cursor will be changed only once per frame and only the most recent cursor change request will take effect. * Remove unneeded scale plugin return functions