[Xfce4-commits] [panel-plugins/xfce4-whiskermenu-plugin] 03/06: Rename section button.

noreply at xfce.org noreply at xfce.org
Fri Feb 7 01:56:24 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 a065bdcf91485bd420744df5f76b25d1c999d305
Author: Graeme Gott <graeme at gottcode.org>
Date:   Thu Feb 6 12:50:35 2020 -0500

    Rename section button.
---
 panel-plugin/CMakeLists.txt                        |  2 +-
 panel-plugin/applications-page.cpp                 |  6 +++---
 panel-plugin/applications-page.h                   |  1 -
 .../{section-button.cpp => category-button.cpp}    |  8 ++++----
 .../{section-button.h => category-button.h}        | 22 +++++++++++-----------
 panel-plugin/category.cpp                          |  6 +++---
 panel-plugin/category.h                            |  6 +++---
 panel-plugin/window.cpp                            | 10 +++++-----
 panel-plugin/window.h                              | 10 +++++-----
 9 files changed, 35 insertions(+), 36 deletions(-)

diff --git a/panel-plugin/CMakeLists.txt b/panel-plugin/CMakeLists.txt
index b2cc4b1..64e15f7 100644
--- a/panel-plugin/CMakeLists.txt
+++ b/panel-plugin/CMakeLists.txt
@@ -9,6 +9,7 @@ pkg_check_modules(libxfce4util REQUIRED IMPORTED_TARGET libxfce4util-1.0>=4.11)
 add_library(whiskermenu MODULE
 	applications-page.cpp
 	category.cpp
+	category-button.cpp
 	command.cpp
 	command-edit.cpp
 	element.cpp
@@ -29,7 +30,6 @@ add_library(whiskermenu MODULE
 	run-action.cpp
 	search-action.cpp
 	search-page.cpp
-	section-button.cpp
 	settings.cpp
 	settings-dialog.cpp
 	slot.h
diff --git a/panel-plugin/applications-page.cpp b/panel-plugin/applications-page.cpp
index 093e5de..2584000 100644
--- a/panel-plugin/applications-page.cpp
+++ b/panel-plugin/applications-page.cpp
@@ -18,9 +18,9 @@
 #include "applications-page.h"
 
 #include "category.h"
+#include "category-button.h"
 #include "launcher.h"
 #include "launcher-view.h"
-#include "section-button.h"
 #include "settings.h"
 #include "slot.h"
 #include "window.h"
@@ -314,10 +314,10 @@ void ApplicationsPage::load_contents()
 	get_view()->set_model(m_categories.front()->get_model());
 
 	// Add buttons for categories
-	std::vector<SectionButton*> category_buttons;
+	std::vector<CategoryButton*> category_buttons;
 	for (auto category : m_categories)
 	{
-		SectionButton* category_button = category->get_button();
+		CategoryButton* category_button = category->get_button();
 		g_signal_connect_slot(category_button->get_widget(), "toggled", &ApplicationsPage::apply_filter, this);
 		category_buttons.push_back(category_button);
 	}
diff --git a/panel-plugin/applications-page.h b/panel-plugin/applications-page.h
index a405f3b..df22855 100644
--- a/panel-plugin/applications-page.h
+++ b/panel-plugin/applications-page.h
@@ -30,7 +30,6 @@ namespace WhiskerMenu
 {
 
 class Category;
-class SectionButton;
 
 class ApplicationsPage : public Page
 {
diff --git a/panel-plugin/section-button.cpp b/panel-plugin/category-button.cpp
similarity index 95%
rename from panel-plugin/section-button.cpp
rename to panel-plugin/category-button.cpp
index 28cc64f..8378161 100644
--- a/panel-plugin/section-button.cpp
+++ b/panel-plugin/category-button.cpp
@@ -15,7 +15,7 @@
  * along with this library.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#include "section-button.h"
+#include "category-button.h"
 
 #include "settings.h"
 
@@ -58,7 +58,7 @@ static gboolean on_focus_in_event(GtkWidget* widget, GdkEvent*, gpointer)
 
 //-----------------------------------------------------------------------------
 
-SectionButton::SectionButton(GIcon* icon, const gchar* text)
+CategoryButton::CategoryButton(GIcon* icon, const gchar* text)
 {
 	m_button = GTK_RADIO_BUTTON(gtk_radio_button_new(nullptr));
 	gtk_toggle_button_set_mode(GTK_TOGGLE_BUTTON(m_button), false);
@@ -84,14 +84,14 @@ SectionButton::SectionButton(GIcon* icon, const gchar* text)
 
 //-----------------------------------------------------------------------------
 
-SectionButton::~SectionButton()
+CategoryButton::~CategoryButton()
 {
 	gtk_widget_destroy(GTK_WIDGET(m_button));
 }
 
 //-----------------------------------------------------------------------------
 
-void SectionButton::reload_icon_size()
+void CategoryButton::reload_icon_size()
 {
 	int size = wm_settings->category_icon_size.get_size();
 	gtk_image_set_pixel_size(GTK_IMAGE(m_icon), size);
diff --git a/panel-plugin/section-button.h b/panel-plugin/category-button.h
similarity index 73%
rename from panel-plugin/section-button.h
rename to panel-plugin/category-button.h
index 9e90936..5d58d88 100644
--- a/panel-plugin/section-button.h
+++ b/panel-plugin/category-button.h
@@ -15,24 +15,24 @@
  * along with this library.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef WHISKERMENU_SECTION_BUTTON_H
-#define WHISKERMENU_SECTION_BUTTON_H
+#ifndef WHISKERMENU_CATEGORY_BUTTON_H
+#define WHISKERMENU_CATEGORY_BUTTON_H
 
 #include <gtk/gtk.h>
 
 namespace WhiskerMenu
 {
 
-class SectionButton
+class CategoryButton
 {
 public:
-	SectionButton(GIcon* icon, const gchar* text);
-	~SectionButton();
+	CategoryButton(GIcon* icon, const gchar* text);
+	~CategoryButton();
 
-	SectionButton(const SectionButton&) = delete;
-	SectionButton(SectionButton&&) = delete;
-	SectionButton& operator=(const SectionButton&) = delete;
-	SectionButton& operator=(SectionButton&&) = delete;
+	CategoryButton(const CategoryButton&) = delete;
+	CategoryButton(CategoryButton&&) = delete;
+	CategoryButton& operator=(const CategoryButton&) = delete;
+	CategoryButton& operator=(CategoryButton&&) = delete;
 
 	GtkWidget* get_widget() const
 	{
@@ -49,7 +49,7 @@ public:
 		gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(m_button), active);
 	}
 
-	void join_group(SectionButton* button)
+	void join_group(CategoryButton* button)
 	{
 		gtk_radio_button_join_group(m_button, button->m_button);
 	}
@@ -65,4 +65,4 @@ private:
 
 }
 
-#endif // WHISKERMENU_SECTION_BUTTON_H
+#endif // WHISKERMENU_CATEGORY_BUTTON_H
diff --git a/panel-plugin/category.cpp b/panel-plugin/category.cpp
index 6f3b72e..2992af5 100644
--- a/panel-plugin/category.cpp
+++ b/panel-plugin/category.cpp
@@ -17,8 +17,8 @@
 
 #include "category.h"
 
+#include "category-button.h"
 #include "launcher-view.h"
-#include "section-button.h"
 
 #include <algorithm>
 
@@ -72,11 +72,11 @@ Category::~Category()
 
 //-----------------------------------------------------------------------------
 
-SectionButton* Category::get_button()
+CategoryButton* Category::get_button()
 {
 	if (!m_button)
 	{
-		m_button = new SectionButton(get_icon(), get_text());
+		m_button = new CategoryButton(get_icon(), get_text());
 	}
 
 	return m_button;
diff --git a/panel-plugin/category.h b/panel-plugin/category.h
index 3f1e5e3..958a774 100644
--- a/panel-plugin/category.h
+++ b/panel-plugin/category.h
@@ -28,7 +28,7 @@
 namespace WhiskerMenu
 {
 
-class SectionButton;
+class CategoryButton;
 
 class Category : public Element
 {
@@ -36,7 +36,7 @@ public:
 	explicit Category(GarconMenuDirectory* directory);
 	~Category();
 
-	SectionButton* get_button();
+	CategoryButton* get_button();
 
 	GtkTreeModel* get_model();
 
@@ -65,7 +65,7 @@ private:
 	void unset_model();
 
 private:
-	SectionButton* m_button;
+	CategoryButton* m_button;
 	std::vector<Element*> m_items;
 	GtkTreeModel* m_model;
 	bool m_has_separators;
diff --git a/panel-plugin/window.cpp b/panel-plugin/window.cpp
index b5e019c..d586923 100644
--- a/panel-plugin/window.cpp
+++ b/panel-plugin/window.cpp
@@ -18,6 +18,7 @@
 #include "window.h"
 
 #include "applications-page.h"
+#include "category-button.h"
 #include "command.h"
 #include "favorites-page.h"
 #include "launcher-view.h"
@@ -26,7 +27,6 @@
 #include "recent-page.h"
 #include "resizer-widget.h"
 #include "search-page.h"
-#include "section-button.h"
 #include "settings.h"
 #include "slot.h"
 
@@ -151,7 +151,7 @@ WhiskerMenu::Window::Window(Plugin* plugin) :
 	m_favorites = new FavoritesPage(this);
 
 	GIcon* icon = g_themed_icon_new("user-bookmarks");
-	m_favorites_button = new SectionButton(icon, _("Favorites"));
+	m_favorites_button = new CategoryButton(icon, _("Favorites"));
 	g_object_unref(icon);
 	g_signal_connect_slot<GtkToggleButton*>(m_favorites_button->get_widget(), "toggled", &Window::favorites_toggled, this);
 
@@ -159,7 +159,7 @@ WhiskerMenu::Window::Window(Plugin* plugin) :
 	m_recent = new RecentPage(this);
 
 	icon = g_themed_icon_new("document-open-recent");
-	m_recent_button = new SectionButton(icon, _("Recently Used"));
+	m_recent_button = new CategoryButton(icon, _("Recently Used"));
 	g_object_unref(icon);
 	m_recent_button->join_group(m_favorites_button);
 	g_signal_connect_slot<GtkToggleButton*>(m_recent_button->get_widget(), "toggled", &Window::recent_toggled, this);
@@ -542,9 +542,9 @@ void WhiskerMenu::Window::on_context_menu_destroyed()
 
 //-----------------------------------------------------------------------------
 
-void WhiskerMenu::Window::set_categories(const std::vector<SectionButton*>& categories)
+void WhiskerMenu::Window::set_categories(const std::vector<CategoryButton*>& categories)
 {
-	SectionButton* last_button = m_recent_button;
+	CategoryButton* last_button = m_recent_button;
 	for (auto button : categories)
 	{
 		button->join_group(last_button);
diff --git a/panel-plugin/window.h b/panel-plugin/window.h
index c09ef82..b02cfb2 100644
--- a/panel-plugin/window.h
+++ b/panel-plugin/window.h
@@ -26,6 +26,7 @@ namespace WhiskerMenu
 {
 
 class ApplicationsPage;
+class CategoryButton;
 class FavoritesPage;
 class Page;
 class Plugin;
@@ -33,7 +34,6 @@ class ProfilePicture;
 class ResizerWidget;
 class RecentPage;
 class SearchPage;
-class SectionButton;
 
 class Window
 {
@@ -82,7 +82,7 @@ public:
 	void show(const Position position);
 	void save();
 	void on_context_menu_destroyed();
-	void set_categories(const std::vector<SectionButton*>& categories);
+	void set_categories(const std::vector<CategoryButton*>& categories);
 	void set_items();
 	void set_loaded();
 	void unset_items();
@@ -146,9 +146,9 @@ private:
 
 	GtkScrolledWindow* m_sidebar;
 	GtkBox* m_sidebar_buttons;
-	SectionButton* m_favorites_button;
-	SectionButton* m_recent_button;
-	SectionButton* m_default_button;
+	CategoryButton* m_favorites_button;
+	CategoryButton* m_recent_button;
+	CategoryButton* m_default_button;
 	GtkSizeGroup* m_sidebar_size_group;
 
 	GdkRectangle m_geometry;

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


More information about the Xfce4-commits mailing list