[Xfce4-commits] [panel-plugins/xfce4-whiskermenu-plugin] 01/01: Fix not showing tooltip over profile picture. (bug #15501)
noreply at xfce.org
noreply at xfce.org
Sat Jan 4 21:14:05 CET 2020
This is an automated email from the git hooks/post-receive script.
g o t t c o d e 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 panel-plugins/xfce4-whiskermenu-plugin.
commit 7c4436240dbbb1f7dcf3439ad20dddc632ed67a0
Author: Graeme Gott <graeme at gottcode.org>
Date: Sat Jan 4 15:12:07 2020 -0500
Fix not showing tooltip over profile picture. (bug #15501)
---
panel-plugin/command.h | 7 ++++++-
panel-plugin/profile-picture.cpp | 13 ++++++++++++-
panel-plugin/profile-picture.h | 4 +++-
panel-plugin/window.cpp | 3 ++-
4 files changed, 23 insertions(+), 4 deletions(-)
diff --git a/panel-plugin/command.h b/panel-plugin/command.h
index 36c3304..549cc52 100644
--- a/panel-plugin/command.h
+++ b/panel-plugin/command.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2013, 2018 Graeme Gott <graeme at gottcode.org>
+ * Copyright (C) 2013, 2018, 2020 Graeme Gott <graeme at gottcode.org>
*
* This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -47,6 +47,11 @@ public:
return m_mnemonic;
}
+ const gchar* get_tooltip() const
+ {
+ return m_text;
+ }
+
void set(const gchar* command);
void set_shown(bool shown);
diff --git a/panel-plugin/profile-picture.cpp b/panel-plugin/profile-picture.cpp
index 0f08de9..d217b68 100644
--- a/panel-plugin/profile-picture.cpp
+++ b/panel-plugin/profile-picture.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2014, 2016, 2017 Graeme Gott <graeme at gottcode.org>
+ * Copyright (C) 2014, 2016, 2017, 2020 Graeme Gott <graeme at gottcode.org>
*
* This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -44,6 +44,9 @@ ProfilePicture::ProfilePicture(Window* window) :
g_signal_connect_slot<GtkWidget*, GdkEvent*>(m_container, "button-press-event", &ProfilePicture::on_button_press_event, this);
gtk_container_add(GTK_CONTAINER(m_container), m_image);
+ Command* command = wm_settings->command[Settings::CommandProfile];
+ gtk_widget_set_tooltip_text(m_container, command->get_tooltip());
+
gchar* path = g_build_filename(g_get_home_dir(), ".face", NULL);
GFile* file = g_file_new_for_path(path);
g_free(path);
@@ -65,6 +68,14 @@ ProfilePicture::~ProfilePicture()
//-----------------------------------------------------------------------------
+void ProfilePicture::reset_tooltip()
+{
+ Command* command = wm_settings->command[Settings::CommandProfile];
+ gtk_widget_set_has_tooltip(m_container, command->get_shown());
+}
+
+//-----------------------------------------------------------------------------
+
void ProfilePicture::on_file_changed(GFileMonitor*, GFile* file, GFile*, GFileMonitorEvent)
{
if (g_file_query_exists(file, NULL))
diff --git a/panel-plugin/profile-picture.h b/panel-plugin/profile-picture.h
index 6593978..72cd3a4 100644
--- a/panel-plugin/profile-picture.h
+++ b/panel-plugin/profile-picture.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2014, 2016 Graeme Gott <graeme at gottcode.org>
+ * Copyright (C) 2014, 2016, 2020 Graeme Gott <graeme at gottcode.org>
*
* This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -36,6 +36,8 @@ public:
return m_container;
}
+ void reset_tooltip();
+
private:
void on_file_changed(GFileMonitor* monitor, GFile* file, GFile* other_file, GFileMonitorEvent event_type);
void on_button_press_event();
diff --git a/panel-plugin/window.cpp b/panel-plugin/window.cpp
index 80fdf48..14c0c94 100644
--- a/panel-plugin/window.cpp
+++ b/panel-plugin/window.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2013, 2014, 2015, 2016, 2017, 2018 Graeme Gott <graeme at gottcode.org>
+ * Copyright (C) 2013, 2014, 2015, 2016, 2017, 2018, 2020 Graeme Gott <graeme at gottcode.org>
*
* This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -332,6 +332,7 @@ void WhiskerMenu::Window::show(const Position position)
m_recent->get_view()->hide_tooltips();
m_applications->get_view()->hide_tooltips();
}
+ m_profilepic->reset_tooltip();
// Make sure commands are valid and visible
for (int i = 0; i < Settings::CountCommands; ++i)
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list