[Xfce4-commits] [panel-plugins/xfce4-whiskermenu-plugin] 324/473: Added "single panel row" option
noreply at xfce.org
noreply at xfce.org
Mon Feb 16 23:58:14 CET 2015
This is an automated email from the git hooks/post-receive script.
gottcode pushed a commit to branch master
in repository panel-plugins/xfce4-whiskermenu-plugin.
commit 314aa2f975e73150bf0933b87ac263c2aff0b2d4
Author: Andrzej <ndrwrdck at gmail.com>
Date: Sun Dec 29 20:23:26 2013 +0000
Added "single panel row" option
---
panel-plugin/configuration-dialog.cpp | 15 +++++++++++++++
panel-plugin/configuration-dialog.h | 2 ++
panel-plugin/plugin.cpp | 2 +-
panel-plugin/settings.cpp | 3 +++
panel-plugin/settings.h | 1 +
5 files changed, 22 insertions(+), 1 deletion(-)
diff --git a/panel-plugin/configuration-dialog.cpp b/panel-plugin/configuration-dialog.cpp
index 3edf4f9..51abd92 100644
--- a/panel-plugin/configuration-dialog.cpp
+++ b/panel-plugin/configuration-dialog.cpp
@@ -155,6 +155,7 @@ void ConfigurationDialog::item_icon_size_changed(GtkComboBox* combo)
void ConfigurationDialog::style_changed(GtkComboBox* combo)
{
m_plugin->set_button_style(Plugin::ButtonStyle(gtk_combo_box_get_active(combo) + 1));
+ gtk_widget_set_sensitive(m_button_single_row, gtk_combo_box_get_active(combo) == 0);
}
//-----------------------------------------------------------------------------
@@ -167,6 +168,14 @@ void ConfigurationDialog::title_changed(GtkEditable* editable)
//-----------------------------------------------------------------------------
+void ConfigurationDialog::toggle_button_single_row(GtkToggleButton* button)
+{
+ wm_settings->button_single_row = gtk_toggle_button_get_active(button);
+ m_plugin->set_button_style(Plugin::ButtonStyle(gtk_combo_box_get_active(GTK_COMBO_BOX(m_button_style)) + 1));
+}
+
+//-----------------------------------------------------------------------------
+
void ConfigurationDialog::toggle_hover_switch_category(GtkToggleButton* button)
{
wm_settings->category_hover_activate = gtk_toggle_button_get_active(button);
@@ -498,6 +507,12 @@ GtkWidget* ConfigurationDialog::init_appearance_tab()
xfce_panel_image_set_size(XFCE_PANEL_IMAGE(m_icon), 48);
gtk_container_add(GTK_CONTAINER(m_icon_button), m_icon);
+ m_button_single_row = gtk_check_button_new_with_mnemonic(_("Lay out icon in a single _panel row"));
+ gtk_box_pack_start(panel_vbox, m_button_single_row, true, true, 0);
+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(m_button_single_row), wm_settings->button_single_row);
+ gtk_widget_set_sensitive(m_button_single_row, gtk_combo_box_get_active(GTK_COMBO_BOX (m_button_style)) == 0);
+ g_signal_connect_slot(m_button_single_row, "toggled", &ConfigurationDialog::toggle_button_single_row, this);
+
// Create menu section
label_size_group = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
GtkBox* appearance_vbox = GTK_BOX(gtk_vbox_new(false, 6));
diff --git a/panel-plugin/configuration-dialog.h b/panel-plugin/configuration-dialog.h
index 1e3314f..47e3eb8 100644
--- a/panel-plugin/configuration-dialog.h
+++ b/panel-plugin/configuration-dialog.h
@@ -53,6 +53,7 @@ private:
void title_changed(GtkEditable* editable);
void choose_icon();
+ void toggle_button_single_row(GtkToggleButton* button);
void toggle_hover_switch_category(GtkToggleButton* button);
void toggle_remember_favorites(GtkToggleButton* button);
void toggle_display_recent(GtkToggleButton* button);
@@ -75,6 +76,7 @@ private:
Plugin* m_plugin;
GtkWidget* m_window;
+ GtkWidget* m_button_single_row;
GtkWidget* m_show_generic_names;
GtkWidget* m_show_descriptions;
GtkWidget* m_show_hierarchy;
diff --git a/panel-plugin/plugin.cpp b/panel-plugin/plugin.cpp
index 6131668..01680c4 100644
--- a/panel-plugin/plugin.cpp
+++ b/panel-plugin/plugin.cpp
@@ -349,7 +349,7 @@ gboolean Plugin::size_changed(XfcePanelPlugin*, gint size)
xfce_panel_image_set_size(m_button_icon, row_size - border);
#if (LIBXFCE4PANEL_CHECK_VERSION(4,9,0))
- if (wm_settings->button_title_visible && (mode == XFCE_PANEL_PLUGIN_MODE_DESKBAR))
+ if (wm_settings->button_title_visible || !wm_settings->button_single_row)
{
xfce_panel_plugin_set_small(m_plugin, false);
diff --git a/panel-plugin/settings.cpp b/panel-plugin/settings.cpp
index c550cb4..630a28a 100644
--- a/panel-plugin/settings.cpp
+++ b/panel-plugin/settings.cpp
@@ -85,6 +85,7 @@ Settings::Settings() :
button_icon_name("xfce4-whiskermenu"),
button_title_visible(false),
button_icon_visible(true),
+ button_single_row(false),
launcher_show_name(true),
launcher_show_description(true),
@@ -159,6 +160,7 @@ void Settings::load(char* file)
button_title = xfce_rc_read_entry(rc, "button-title", button_title.c_str());
button_icon_name = xfce_rc_read_entry(rc, "button-icon", button_icon_name.c_str());
+ button_single_row = xfce_rc_read_bool_entry(rc, "button-single-row", button_single_row);
button_title_visible = xfce_rc_read_bool_entry(rc, "show-button-title", button_title_visible);
button_icon_visible = xfce_rc_read_bool_entry(rc, "show-button-icon", button_icon_visible);
@@ -250,6 +252,7 @@ void Settings::save(char* file)
xfce_rc_write_entry(rc, "button-title", button_title.c_str());
xfce_rc_write_entry(rc, "button-icon", button_icon_name.c_str());
+ xfce_rc_write_bool_entry(rc, "button-single-row", button_single_row);
xfce_rc_write_bool_entry(rc, "show-button-title", button_title_visible);
xfce_rc_write_bool_entry(rc, "show-button-icon", button_icon_visible);
diff --git a/panel-plugin/settings.h b/panel-plugin/settings.h
index 9e7e325..24ee6f3 100644
--- a/panel-plugin/settings.h
+++ b/panel-plugin/settings.h
@@ -63,6 +63,7 @@ public:
std::string button_icon_name;
bool button_title_visible;
bool button_icon_visible;
+ bool button_single_row;
bool launcher_show_name;
bool launcher_show_description;
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list