[Xfce4-commits] [panel-plugins/xfce4-whiskermenu-plugin] 424/473: Fixed missing drop shadow on opaque menus.

noreply at xfce.org noreply at xfce.org
Mon Feb 16 23:59:54 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 eabf6fe362e0938171b89cf30cd32e95d165cb31
Author: Graeme Gott <graeme at gottcode.org>
Date:   Mon Dec 8 07:17:29 2014 -0500

    Fixed missing drop shadow on opaque menus.
---
 panel-plugin/window.cpp |   12 ++++++++++--
 panel-plugin/window.h   |    1 +
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/panel-plugin/window.cpp b/panel-plugin/window.cpp
index 6f76fe7..b363691 100644
--- a/panel-plugin/window.cpp
+++ b/panel-plugin/window.cpp
@@ -45,7 +45,8 @@ WhiskerMenu::Window::Window() :
 	m_layout_bottom(true),
 	m_layout_search_alternate(false),
 	m_layout_commands_alternate(false),
-	m_supports_alpha(false)
+	m_supports_alpha(false),
+	m_opacity(wm_settings->menu_opacity)
 {
 	m_geometry.x = 0;
 	m_geometry.y = 0;
@@ -279,6 +280,13 @@ void WhiskerMenu::Window::hide()
 
 void WhiskerMenu::Window::show(GtkWidget* parent, bool horizontal)
 {
+	// Handle change in opacity
+	if (wm_settings->menu_opacity != m_opacity)
+	{
+		m_opacity = wm_settings->menu_opacity;
+		on_screen_changed_event(GTK_WIDGET(m_window), NULL);
+	}
+
 	// Make sure icon sizes are correct
 	m_favorites_button->reload_icon_size();
 	m_recent_button->reload_icon_size();
@@ -822,7 +830,7 @@ void WhiskerMenu::Window::on_screen_changed_event(GtkWidget* widget, GdkScreen*)
 {
 	GdkScreen* screen = gtk_widget_get_screen(widget);
 	GdkColormap* colormap = gdk_screen_get_rgba_colormap(screen);
-	if (!colormap)
+	if (!colormap || (m_opacity == 100))
 	{
 		colormap = gdk_screen_get_system_colormap(screen);
 		m_supports_alpha = false;
diff --git a/panel-plugin/window.h b/panel-plugin/window.h
index 1345341..68dfc84 100644
--- a/panel-plugin/window.h
+++ b/panel-plugin/window.h
@@ -133,6 +133,7 @@ private:
 	bool m_layout_search_alternate;
 	bool m_layout_commands_alternate;
 	bool m_supports_alpha;
+	int m_opacity;
 };
 
 }

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list