Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Panel Plugins
xfce4-whiskermenu-plugin
Commits
354951d7
Commit
354951d7
authored
Nov 07, 2021
by
Graeme Gott
Browse files
Save less frequently
parent
b4d22fa5
Changes
3
Hide whitespace changes
Inline
Side-by-side
panel-plugin/plugin.cpp
View file @
354951d7
...
...
@@ -198,8 +198,6 @@ Plugin::Plugin(XfcePanelPlugin* plugin) :
Plugin
::~
Plugin
()
{
save
();
delete
m_window
;
m_window
=
nullptr
;
...
...
@@ -232,7 +230,6 @@ void Plugin::menu_hidden(bool lost_focus)
m_menu_shown
=
false
;
}
gtk_toggle_button_set_active
(
GTK_TOGGLE_BUTTON
(
m_button
),
false
);
save
();
}
//-----------------------------------------------------------------------------
...
...
@@ -407,8 +404,6 @@ gboolean Plugin::remote_event(const gchar* name, const GValue* value)
void
Plugin
::
save
()
{
m_window
->
save
();
if
(
wm_settings
->
get_modified
())
{
wm_settings
->
save
(
xfce_panel_plugin_save_location
(
m_plugin
,
true
));
...
...
panel-plugin/window.cpp
View file @
354951d7
...
...
@@ -374,6 +374,10 @@ WhiskerMenu::Window::~Window()
void
WhiskerMenu
::
Window
::
hide
(
bool
lost_focus
)
{
// Save size
wm_settings
->
menu_width
=
m_geometry
.
width
;
wm_settings
->
menu_height
=
m_geometry
.
height
;
// Scroll categories to top
GtkAdjustment
*
adjustment
=
gtk_scrolled_window_get_vadjustment
(
m_sidebar
);
gtk_adjustment_set_value
(
adjustment
,
gtk_adjustment_get_lower
(
adjustment
));
...
...
@@ -583,20 +587,6 @@ void WhiskerMenu::Window::show(const Position position)
//-----------------------------------------------------------------------------
void
WhiskerMenu
::
Window
::
save
()
{
if
(
wm_settings
->
menu_width
!=
m_geometry
.
width
)
{
wm_settings
->
menu_width
=
m_geometry
.
width
;
}
if
(
wm_settings
->
menu_height
!=
m_geometry
.
height
)
{
wm_settings
->
menu_height
=
m_geometry
.
height
;
}
}
//-----------------------------------------------------------------------------
void
WhiskerMenu
::
Window
::
set_child_has_focus
()
{
m_child_has_focus
=
true
;
...
...
panel-plugin/window.h
View file @
354951d7
...
...
@@ -80,7 +80,6 @@ public:
void
hide
(
bool
lost_focus
=
false
);
void
show
(
const
Position
position
);
void
save
();
void
set_child_has_focus
();
void
set_categories
(
const
std
::
vector
<
CategoryButton
*>&
categories
);
void
set_items
();
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment