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.
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.
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.
* 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
The bug was actually due to a presence of a ghost tab scrolling button
in all the views.
We need to check if the node has multiple views, if not there are no tabs
and therefore no scrolling button areas so we return nothing from the
method Node:get_scroll_button_index().
Close#216
Now toolbarview always compute up-to-date sizes and spacing to adapt to
changes in icon big font.
For treeview and toolbarview revert the goto_size approach to use the
original approach of rxi/lite. In order to make it work when user resizes
dragging the divider we use the view optional method set_target_size().
This latter changes the view's target size instead of changing its size
right away. The size is only changed by the lite's layout and animation
system.
Remove the config.treeview_size variable that was no longer working because
plugins are loaded before the user's config.