Skip to content

Commit

Permalink
Add button to pop out plugins panel
Browse files Browse the repository at this point in the history
The draggable plugins panel is impossible to discover for new users.
The added button pops out the plugins panel without opening it fully,
so that users can realize that the panel exists and is draggable.
  • Loading branch information
arch1t3cht committed Sep 19, 2024
1 parent eeee1c1 commit 594a231
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion vspreview/main/window.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

from ..core import (
PRELOADED_MODULES, AbstractQItem, ArInfo, CroppingInfo, DragNavigator, ExtendedWidget, Frame, GraphicsImageItem,
GraphicsView, HBoxLayout, MainVideoOutputGraphicsView, QAbstractYAMLObjectSingleton, StatusBar, Time, Timer,
GraphicsView, HBoxLayout, MainVideoOutputGraphicsView, PushButton, QAbstractYAMLObjectSingleton, StatusBar, Time, Timer,
VBoxLayout, VideoOutput, _monkey_runpy_dicts, apply_plotting_style, dispose_environment, get_current_environment,
make_environment
)
Expand Down Expand Up @@ -192,6 +192,18 @@ def __init__(self, config_dir: SPath, no_exit: bool, reload_enabled: bool, force

Plugins(self)

def pop_out_plugins():
left, right = self.main_split.sizes()
if right:
new_sizes = [left + right, 0]
else:
min_right = int((left + right) * 0.2)
new_sizes = [min(left, left + right - min_right), max(right, min_right)]
self.main_split.setSizes(new_sizes)
self.plugins.update()

self.toolbars.main.layout().addWidget(PushButton("Plugins", clicked=pop_out_plugins))

self.app_settings.tab_widget.setUsesScrollButtons(False)
self.app_settings.setMinimumWidth(
int(len(self.toolbars) * 1.05 * self.app_settings.tab_widget.geometry().width() / 2)
Expand Down

0 comments on commit 594a231

Please sign in to comment.