[Xfce4-commits] [xfce/xfce4-panel] 01/01: Move "Separator" to the top of the "Add New Items..." menu (Bug #14086)
noreply at xfce.org
noreply at xfce.org
Wed Jan 3 15:41:45 CET 2018
This is an automated email from the git hooks/post-receive script.
o c h o s i p u s h e d a c o m m i t t o b r a n c h m a s t e r
in repository xfce/xfce4-panel.
commit 9c2416cdb240ae174f14d6f03f2ebf44ebab4f8c
Author: Simon Steinbeiss <simon.steinbeiss at elfenbeinturm.at>
Date: Wed Jan 3 15:41:30 2018 +0100
Move "Separator" to the top of the "Add New Items..." menu (Bug #14086)
This makes the separator more accessible, as this is one of the few plugins
that you may want to add to a panel multiple times.
---
panel/panel-item-dialog.c | 14 +++++++++++++-
panel/panel-module-factory.h | 3 ++-
2 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/panel/panel-item-dialog.c b/panel/panel-item-dialog.c
index ddb3a1b..ef7e3d0 100644
--- a/panel/panel-item-dialog.c
+++ b/panel/panel-item-dialog.c
@@ -609,7 +609,7 @@ panel_item_dialog_populate_store (PanelItemDialog *dialog)
/* add an empty item for separator in 2nd position */
if (panel_module_factory_has_launcher (dialog->factory))
- gtk_list_store_insert_with_values (dialog->store, &iter, 1,
+ gtk_list_store_insert_with_values (dialog->store, &iter, 2,
COLUMN_MODULE, NULL, -1);
}
@@ -648,6 +648,18 @@ panel_item_dialog_compare_func (GtkTreeModel *model,
/* move the launcher to the first position */
result = 1;
}
+ else if (g_strcmp0 (SEPARATOR_PLUGIN_NAME,
+ panel_module_get_name (module_a)) == 0)
+ {
+ /* move the separator to the second position */
+ result = -1;
+ }
+ else if (g_strcmp0 (SEPARATOR_PLUGIN_NAME,
+ panel_module_get_name (module_b)) == 0)
+ {
+ /* move the separator to the second position */
+ result = 1;
+ }
else
{
/* get the visible module names */
diff --git a/panel/panel-module-factory.h b/panel/panel-module-factory.h
index eaedfe1..50ff13a 100644
--- a/panel/panel-module-factory.h
+++ b/panel/panel-module-factory.h
@@ -36,7 +36,8 @@ typedef struct _PanelModuleFactory PanelModuleFactory;
#define PANEL_IS_MODULE_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PANEL_TYPE_MODULE_FACTORY))
#define PANEL_MODULE_FACTORY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PANEL_TYPE_MODULE_FACTORY, PanelModuleFactoryClass))
-#define LAUNCHER_PLUGIN_NAME "launcher"
+#define LAUNCHER_PLUGIN_NAME "launcher"
+#define SEPARATOR_PLUGIN_NAME "separator"
GType panel_module_factory_get_type (void) G_GNUC_CONST;
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list