[Xfce4-commits] [panel-plugins/xfce4-whiskermenu-plugin] 319/473: Force panel icon size.
noreply at xfce.org
noreply at xfce.org
Mon Feb 16 23:58:09 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 0d56cb882ac0e265628e3104ae2e26d1e2f64a91
Author: Graeme Gott <graeme at gottcode.org>
Date: Sun Dec 15 09:21:44 2013 -0500
Force panel icon size.
---
panel-plugin/plugin.cpp | 49 ++++++++++++++++-------------------------------
1 file changed, 16 insertions(+), 33 deletions(-)
diff --git a/panel-plugin/plugin.cpp b/panel-plugin/plugin.cpp
index 3095b3c..1605afd 100644
--- a/panel-plugin/plugin.cpp
+++ b/panel-plugin/plugin.cpp
@@ -341,46 +341,29 @@ gboolean Plugin::size_changed(XfcePanelPlugin*, gint size)
GtkOrientation orientation = xfce_panel_plugin_get_orientation(m_plugin);
#endif
- // Make icon expand to fill button if title is not visible
- gtk_box_set_child_packing(GTK_BOX(m_button_box), GTK_WIDGET(m_button_icon),
- !wm_settings->button_title_visible,
- !wm_settings->button_title_visible,
- 0, GTK_PACK_START);
+ // Resize icon
+ GtkStyle* style = gtk_widget_get_style(m_button);
+ gint border = (2 * std::max(style->xthickness, style->ythickness)) + 2;
+ xfce_panel_image_set_size(m_button_icon, row_size - border);
- if (!wm_settings->button_title_visible)
- {
#if (LIBXFCE4PANEL_CHECK_VERSION(4,9,0))
- xfce_panel_plugin_set_small(m_plugin, true);
-#endif
- xfce_panel_image_set_size(m_button_icon, -1);
- gtk_widget_set_size_request(GTK_WIDGET(m_plugin), row_size, row_size);
- }
- else
+ if (wm_settings->button_title_visible && (mode == XFCE_PANEL_PLUGIN_MODE_DESKBAR))
{
- GtkStyle* style = gtk_widget_get_style(m_button);
- gint border = (2 * std::max(style->xthickness, style->ythickness)) + 2;
- xfce_panel_image_set_size(m_button_icon, row_size - border);
- gtk_widget_set_size_request(GTK_WIDGET(m_plugin), -1, -1);
+ xfce_panel_plugin_set_small(m_plugin, false);
-#if (LIBXFCE4PANEL_CHECK_VERSION(4,9,0))
- if (mode == XFCE_PANEL_PLUGIN_MODE_DESKBAR)
- {
- xfce_panel_plugin_set_small(m_plugin, false);
-
- // Put title next to icon if panel is wide enough
- GtkRequisition label_size;
- gtk_widget_size_request(GTK_WIDGET(m_button_label), &label_size);
- if (label_size.width <= (size - row_size))
- {
- orientation = GTK_ORIENTATION_HORIZONTAL;
- }
- }
- else
+ // Put title next to icon if panel is wide enough
+ GtkRequisition label_size;
+ gtk_widget_size_request(GTK_WIDGET(m_button_label), &label_size);
+ if (label_size.width <= (size - row_size))
{
- xfce_panel_plugin_set_small(m_plugin, true);
+ orientation = GTK_ORIENTATION_HORIZONTAL;
}
-#endif
}
+ else
+ {
+ xfce_panel_plugin_set_small(m_plugin, true);
+ }
+#endif
gtk_orientable_set_orientation(GTK_ORIENTABLE(m_button_box), orientation);
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list