[gnote] Remove unused ToolMenuButton
- From: Aurimas Černius <aurimasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnote] Remove unused ToolMenuButton
- Date: Sun, 2 May 2021 18:46:47 +0000 (UTC)
commit f932c86d5c05b127d2b14524bb7f9bf3ec0f7d48
Author: Aurimas Černius <aurisc4 gmail com>
Date: Sun May 2 20:23:48 2021 +0300
Remove unused ToolMenuButton
src/utils.cpp | 81 -----------------------------------------------------------
src/utils.hpp | 23 -----------------
2 files changed, 104 deletions(-)
---
diff --git a/src/utils.cpp b/src/utils.cpp
index f809ef21..09570d60 100644
--- a/src/utils.cpp
+++ b/src/utils.cpp
@@ -26,13 +26,10 @@
#include <algorithm>
-#include <gtk/gtk.h>
-
#include <glibmm/i18n.h>
#include <glibmm/stringutils.h>
#include <glibmm/threads.h>
#include <gtkmm/checkmenuitem.h>
-#include <gtkmm/icontheme.h>
#include <gtkmm/image.h>
#include <gtkmm/textbuffer.h>
@@ -745,84 +742,6 @@ namespace gnote {
return false;
}
- ToolMenuButton::ToolMenuButton(Gtk::Widget & widget, Gtk::Menu *menu)
- : Gtk::ToggleToolButton(widget)
- , m_menu(menu)
- {
- _common_init();
- }
-
- ToolMenuButton::ToolMenuButton(Gtk::Toolbar& toolbar, const Gtk::BuiltinStockID& stock_image,
- const Glib::ustring & label,
- Gtk::Menu * menu)
- : Gtk::ToggleToolButton()
- , m_menu(menu)
- {
- _common_init(*manage(new Gtk::Image(stock_image, toolbar.get_icon_size())),
- label);
- }
-
- ToolMenuButton::ToolMenuButton(Gtk::Image& image,
- const Glib::ustring & label,
- Gtk::Menu * menu)
- : Gtk::ToggleToolButton()
- , m_menu(menu)
- {
- _common_init(image, label);
- }
-
-
- void ToolMenuButton::_common_init()
- {
- property_can_focus() = true;
- gtk_menu_attach_to_widget(m_menu->gobj(), static_cast<Gtk::Widget*>(this)->gobj(),
- NULL);
- m_menu->signal_deactivate().connect(sigc::mem_fun(*this, &ToolMenuButton::release_button));
- show_all();
- }
-
-
- void ToolMenuButton::_common_init(Gtk::Image& image, const Glib::ustring & label)
- {
- set_icon_widget(image);
- set_label_widget(*manage(new Gtk::Label(label, true)));
- _common_init();
- }
-
-
- bool ToolMenuButton::on_button_press_event(GdkEventButton *ev)
- {
- popup_menu(*m_menu, ev);
- return true;
- }
-
- void ToolMenuButton::on_clicked()
- {
- m_menu->select_first(true);
- popup_menu(*m_menu, NULL);
- }
-
- bool ToolMenuButton::on_mnemonic_activate(bool group_cycling)
- {
- // ToggleButton always grabs focus away from the editor,
- // so reimplement Widget's version, which only grabs the
- // focus if we are group cycling.
- if (!group_cycling) {
- activate();
- }
- else if (get_can_focus()) {
- grab_focus();
- }
-
- return true;
- }
-
-
- void ToolMenuButton::release_button()
- {
- set_active(false);
- }
-
CheckAction::CheckAction(const Glib::ustring & name)
: Gtk::Action(name)
diff --git a/src/utils.hpp b/src/utils.hpp
index 58b5a00d..92af2f14 100644
--- a/src/utils.hpp
+++ b/src/utils.hpp
@@ -35,8 +35,6 @@
#include <gtkmm/textbuffer.h>
#include <gtkmm/textiter.h>
#include <gtkmm/textmark.h>
-#include <gtkmm/toggletoolbutton.h>
-#include <gtkmm/toolbar.h>
#include "sharp/exception.hpp"
#include "sharp/uri.hpp"
@@ -224,27 +222,6 @@ class Preferences;
guint m_timeout_id;
};
- class ToolMenuButton
- : public Gtk::ToggleToolButton
- {
- public:
- ToolMenuButton(Gtk::Widget & widget, Gtk::Menu *menu);
- ToolMenuButton(Gtk::Toolbar& toolbar,
- const Gtk::BuiltinStockID& stock_image,
- const Glib::ustring & label, Gtk::Menu * menu);
- ToolMenuButton(Gtk::Image& image,
- const Glib::ustring & label, Gtk::Menu * menu);
- virtual bool on_button_press_event(GdkEventButton *) override;
- virtual void on_clicked() override;
- virtual bool on_mnemonic_activate(bool group_cycling) override;
-
- private:
- void _common_init();
- void _common_init(Gtk::Image& image, const Glib::ustring & l);
- // managed by gtkmm
- Gtk::Menu *m_menu;
- void release_button();
- };
class CheckAction
: public Gtk::Action
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]