Changeset fb634fcf967dddf76b509e6fa3132384c87a4c65
- Timestamp:
- 09/11/08 21:48:27 (5 years ago)
- Author:
- Armin Burgmeier <armin@…>
- Parents:
- 9a0333e8de963e333740e7609e769dda89ee11c5
- Children:
- fce3ea7cff4296b3af6c3f631e9407f14f6e203e
- git-committer:
- Armin Burgmeier <armin@arbur.net> / 2008-09-11T21:48:27Z+0200
- Message:
-
Added buttons to close the userlist and the browser
2008-09-11 Armin Burgmeier <armin@…>
- inc/core/closableframe.hpp:
- src/core/closableframe.cpp: Added a new widget, derived from
Gtk::Frame, that shows a close button in the upper right corner, for
the frame to be closed.
- inc/core/Makefile.am:
- src/core/Makefile.am: Added the new files to the build.
- inc/core/preferences.hpp:
- src/core/preferences.cpp: Added show_browser and show_userlist
options.
- inc/window.hpp:
- src/window.cpp:
- src/core/docwindow.cpp: Use a ClosableFrame? for the browser and
userlist, respectively.
- src/core/browser.cpp: Removed the border_width. It is now applied by
the ClosableFrame?. If border_width is desired in certain situations,
then it can still be called from elsewhere.
- inc/core/header.hpp:
- src/core/header.cpp: Added "Show Document Browser" and "Show
Userlist" items to the View menu.
- inc/commands/view-commands.hpp:
- src/commands/view-commands.cpp: Implemented functionality for these
(by setting the preference options).
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
|
r9a0333e
|
rfb634fc
|
|
| | 1 | 2008-09-11 Armin Burgmeier <armin@arbur.net> |
| | 2 | |
| | 3 | * inc/core/closableframe.hpp: |
| | 4 | * src/core/closableframe.cpp: Added a new widget, derived from |
| | 5 | Gtk::Frame, that shows a close button in the upper right corner, for |
| | 6 | the frame to be closed. |
| | 7 | |
| | 8 | * inc/core/Makefile.am: |
| | 9 | * src/core/Makefile.am: Added the new files to the build. |
| | 10 | |
| | 11 | * inc/core/preferences.hpp: |
| | 12 | * src/core/preferences.cpp: Added show_browser and show_userlist |
| | 13 | options. |
| | 14 | |
| | 15 | * inc/window.hpp: |
| | 16 | * src/window.cpp: |
| | 17 | * src/core/docwindow.cpp: Use a ClosableFrame for the browser and |
| | 18 | userlist, respectively. |
| | 19 | |
| | 20 | * src/core/browser.cpp: Removed the border_width. It is now applied by |
| | 21 | the ClosableFrame. If border_width is desired in certain situations, |
| | 22 | then it can still be called from elsewhere. |
| | 23 | |
| | 24 | * inc/core/header.hpp: |
| | 25 | * src/core/header.cpp: Added "Show Document Browser" and "Show |
| | 26 | Userlist" items to the View menu. |
| | 27 | |
| | 28 | * inc/commands/view-commands.hpp: |
| | 29 | * src/commands/view-commands.cpp: Implemented functionality for these |
| | 30 | (by setting the preference options). |
| | 31 | |
| 1 | 32 | 2008-09-11 Armin Burgmeier <armin@arbur.net> |
| 2 | 33 | |
-
|
r0706e21
|
rfb634fc
|
|
| 10 | 10 | in InfGtkBrowserModel/Store |
| 11 | 11 | - Sort BrowserModel in Left pane and DocumentLocationDialog |
| 12 | | - Add close buttons to browser in left pane, user lists and docwindow infos, |
| 13 | | and a way to re-show the former two. |
| 14 | 12 | - Set session title as initial file name in Save As filechooser |
| | 13 | - Add base preferences class with Preferences::Option definition to util/, |
| | 14 | inherit in core/, move ClosableFrame to util/ |
| 15 | 15 | |
| 16 | 16 | These things need to be implemented in infinote, but again would be nice |
-
|
rcd63729
|
rfb634fc
|
|
| 40 | 40 | void on_menu_toolbar_toggled(); |
| 41 | 41 | void on_menu_statusbar_toggled(); |
| | 42 | void on_menu_browser_toggled(); |
| | 43 | void on_menu_userlist_toggled(); |
| 42 | 44 | void on_pref_toolbar_changed(); |
| 43 | 45 | void on_pref_statusbar_changed(); |
| | 46 | void on_pref_browser_changed(); |
| | 47 | void on_pref_userlist_changed(); |
| 44 | 48 | |
| 45 | 49 | void on_menu_language_changed( |
| … |
… |
|
| 57 | 61 | |
| 58 | 62 | sigc::connection m_menu_view_toolbar_connection; |
| | 63 | sigc::connection m_menu_view_statusbar_connection; |
| | 64 | sigc::connection m_menu_view_browser_connection; |
| | 65 | sigc::connection m_menu_view_userlist_connection; |
| | 66 | |
| | 67 | sigc::connection m_pref_view_statusbar_connection; |
| 59 | 68 | sigc::connection m_pref_view_toolbar_connection; |
| 60 | | |
| 61 | | sigc::connection m_menu_view_statusbar_connection; |
| 62 | | sigc::connection m_pref_view_statusbar_connection; |
| | 69 | sigc::connection m_pref_view_browser_connection; |
| | 70 | sigc::connection m_pref_view_userlist_connection; |
| 63 | 71 | |
| 64 | 72 | private: |
| … |
… |
|
| 67 | 75 | |
| 68 | 76 | } |
| 69 | | |
| | 77 | |
| 70 | 78 | #endif // _GOBBY_VIEW_COMMANDS_HPP_ |
-
|
r0706e21
|
rfb634fc
|
|
| 2 | 2 | noinst_HEADERS = \ |
| 3 | 3 | browser.hpp \ |
| | 4 | closableframe.hpp \ |
| 4 | 5 | documentinfostorage.hpp \ |
| 5 | 6 | docwindow.hpp \ |
-
|
r91b91f6
|
rfb634fc
|
|
| 121 | 121 | const Glib::RefPtr<Gtk::ToggleAction> action_view_toolbar; |
| 122 | 122 | const Glib::RefPtr<Gtk::ToggleAction> action_view_statusbar; |
| | 123 | const Glib::RefPtr<Gtk::ToggleAction> action_view_browser; |
| | 124 | const Glib::RefPtr<Gtk::ToggleAction> action_view_userlist; |
| 123 | 125 | const Glib::RefPtr<Gtk::Action> action_view_highlight_mode; |
| 124 | 126 | const Glib::RefPtr<LanguageAction> action_view_highlight_none; |
-
|
rcd46e34
|
rfb634fc
|
|
| 142 | 142 | Option<bool> show_toolbar; |
| 143 | 143 | Option<bool> show_statusbar; |
| | 144 | Option<bool> show_browser; |
| | 145 | Option<bool> show_userlist; |
| 144 | 146 | }; |
| 145 | 147 | |
-
|
r40f94d4
|
rfb634fc
|
|
| 46 | 46 | #include <gtkmm/window.h> |
| 47 | 47 | #include <gtkmm/paned.h> |
| 48 | | #include <gtkmm/frame.h> |
| 49 | 48 | #include <gtkmm/messagedialog.h> |
| 50 | 49 | |
| … |
… |
|
| 81 | 80 | Gtk::HPaned m_paned; |
| 82 | 81 | |
| 83 | | Gtk::Frame m_frame_browser; |
| 84 | | Gtk::Frame m_frame_text; |
| 85 | | |
| 86 | 82 | Header m_header; |
| 87 | 83 | Folder m_folder; |
-
|
rf6999d3
|
rfb634fc
|
|
| 36 | 36 | &ViewCommands::on_menu_statusbar_toggled)); |
| 37 | 37 | |
| 38 | | m_pref_view_statusbar_connection = |
| | 38 | m_menu_view_browser_connection = |
| | 39 | m_header.action_view_browser->signal_toggled().connect( |
| | 40 | sigc::mem_fun( |
| | 41 | *this, |
| | 42 | &ViewCommands::on_menu_browser_toggled)); |
| | 43 | |
| | 44 | m_menu_view_userlist_connection = |
| | 45 | m_header.action_view_userlist->signal_toggled().connect( |
| | 46 | sigc::mem_fun( |
| | 47 | *this, |
| | 48 | &ViewCommands::on_menu_userlist_toggled)); |
| | 49 | |
| | 50 | m_pref_view_toolbar_connection = |
| 39 | 51 | preferences.appearance.show_toolbar.signal_changed().connect( |
| 40 | 52 | sigc::mem_fun( |
| … |
… |
|
| 47 | 59 | *this, |
| 48 | 60 | &ViewCommands::on_pref_statusbar_changed)); |
| | 61 | |
| | 62 | m_pref_view_browser_connection = |
| | 63 | preferences.appearance.show_browser.signal_changed().connect( |
| | 64 | sigc::mem_fun( |
| | 65 | *this, |
| | 66 | &ViewCommands::on_pref_browser_changed)); |
| | 67 | |
| | 68 | m_pref_view_userlist_connection = |
| | 69 | preferences.appearance.show_userlist.signal_changed().connect( |
| | 70 | sigc::mem_fun( |
| | 71 | *this, |
| | 72 | &ViewCommands::on_pref_userlist_changed)); |
| 49 | 73 | |
| 50 | 74 | m_folder.signal_document_changed().connect( |
| … |
… |
|
| 112 | 136 | } |
| 113 | 137 | |
| | 138 | void Gobby::ViewCommands::on_menu_browser_toggled() |
| | 139 | { |
| | 140 | m_pref_view_browser_connection.block(); |
| | 141 | m_preferences.appearance.show_browser = |
| | 142 | m_header.action_view_browser->get_active(); |
| | 143 | m_pref_view_browser_connection.unblock(); |
| | 144 | } |
| | 145 | |
| | 146 | void Gobby::ViewCommands::on_menu_userlist_toggled() |
| | 147 | { |
| | 148 | m_pref_view_userlist_connection.block(); |
| | 149 | m_preferences.appearance.show_userlist = |
| | 150 | m_header.action_view_userlist->get_active(); |
| | 151 | m_pref_view_userlist_connection.unblock(); |
| | 152 | } |
| | 153 | |
| 114 | 154 | void Gobby::ViewCommands::on_pref_toolbar_changed() |
| 115 | 155 | { |
| … |
… |
|
| 126 | 166 | m_preferences.appearance.show_statusbar); |
| 127 | 167 | m_menu_view_statusbar_connection.unblock(); |
| | 168 | } |
| | 169 | |
| | 170 | void Gobby::ViewCommands::on_pref_browser_changed() |
| | 171 | { |
| | 172 | m_menu_view_browser_connection.block(); |
| | 173 | m_header.action_view_browser->set_active( |
| | 174 | m_preferences.appearance.show_browser); |
| | 175 | m_menu_view_browser_connection.unblock(); |
| | 176 | } |
| | 177 | |
| | 178 | void Gobby::ViewCommands::on_pref_userlist_changed() |
| | 179 | { |
| | 180 | m_menu_view_userlist_connection.block(); |
| | 181 | m_header.action_view_userlist->set_active( |
| | 182 | m_preferences.appearance.show_userlist); |
| | 183 | m_menu_view_userlist_connection.unblock(); |
| 128 | 184 | } |
| 129 | 185 | |
-
|
r0706e21
|
rfb634fc
|
|
| 3 | 3 | libgobby_core_a_SOURCES = \ |
| 4 | 4 | browser.cpp \ |
| | 5 | closableframe.cpp \ |
| 5 | 6 | documentinfostorage.cpp \ |
| 6 | 7 | docwindow.cpp \ |
-
|
r092ccc3
|
rfb634fc
|
|
| 98 | 98 | |
| 99 | 99 | set_spacing(6); |
| 100 | | set_border_width(6); |
| 101 | 100 | pack_start(m_scroll, Gtk::PACK_EXPAND_WIDGET); |
| 102 | 101 | pack_start(m_expander, Gtk::PACK_SHRINK); |
-
|
r163d1e6
|
rfb634fc
|
|
| 19 | 19 | #include "features.hpp" |
| 20 | 20 | |
| | 21 | #include "core/docwindow.hpp" |
| 21 | 22 | #include "core/preferences.hpp" |
| 22 | | #include "core/docwindow.hpp" |
| | 23 | #include "core/closableframe.hpp" |
| 23 | 24 | |
| 24 | 25 | #include <gtkmm/scrolledwindow.h> |
| … |
… |
|
| 193 | 194 | |
| 194 | 195 | m_userlist.show(); |
| | 196 | Gtk::Frame* frame = Gtk::manage(new ClosableFrame( |
| | 197 | m_preferences.appearance.show_userlist)); |
| | 198 | frame->set_shadow_type(Gtk::SHADOW_IN); |
| | 199 | frame->add(m_userlist); |
| | 200 | // frame manages visibility itself |
| 195 | 201 | |
| 196 | 202 | pack1(*vbox, true, false); |
| 197 | | pack2(m_userlist, false, false); |
| | 203 | pack2(*frame, false, false); |
| | 204 | |
| | 205 | |
| 198 | 206 | } |
| 199 | 207 | |
-
|
r91b91f6
|
rfb634fc
|
|
| 62 | 62 | " <menuitem action=\"ViewStatusbar\" />" |
| 63 | 63 | " <separator />" |
| | 64 | " <menuitem action=\"ViewBrowser\" />" |
| | 65 | " <menuitem action=\"ViewUserlist\" />" |
| | 66 | " <separator />" |
| 64 | 67 | " <menu action=\"ViewHighlightMode\">" |
| 65 | 68 | " <menuitem" |
| … |
… |
|
| 261 | 264 | _("Whether to show the statusbar"), |
| 262 | 265 | preferences.appearance.show_statusbar)), |
| | 266 | action_view_browser( |
| | 267 | Gtk::ToggleAction::create( |
| | 268 | "ViewBrowser", _("View Document Browser"), |
| | 269 | _("Whether to show the document browser"), |
| | 270 | preferences.appearance.show_browser)), |
| | 271 | action_view_userlist( |
| | 272 | Gtk::ToggleAction::create( |
| | 273 | "ViewUserlist", _("View User List"), |
| | 274 | _("Whether to show the user list"), |
| | 275 | preferences.appearance.show_userlist)), |
| 263 | 276 | action_view_highlight_mode( |
| 264 | 277 | Gtk::Action::create("ViewHighlightMode", |
| … |
… |
|
| 318 | 331 | group_edit->add(action_edit_preferences); |
| 319 | 332 | |
| 320 | | group_edit->add(action_view); |
| 321 | | group_edit->add(action_view_toolbar); |
| 322 | | group_edit->add(action_view_statusbar); |
| 323 | | group_edit->add(action_view_highlight_mode); |
| 324 | | group_edit->add(action_view_highlight_none); |
| | 333 | group_view->add(action_view); |
| | 334 | group_view->add(action_view_toolbar); |
| | 335 | group_view->add(action_view_statusbar); |
| | 336 | group_view->add(action_view_browser, |
| | 337 | Gtk::AccelKey("F9", |
| | 338 | "<Actions>/MenuView/ViewBrowser")); |
| | 339 | group_view->add(action_view_userlist, |
| | 340 | Gtk::AccelKey("<control>F9", |
| | 341 | "<Actions>/MenuView/ViewUserList")); |
| | 342 | group_view->add(action_view_highlight_mode); |
| | 343 | group_view->add(action_view_highlight_none); |
| 325 | 344 | for(LanguageMap::const_iterator iter = |
| 326 | 345 | action_view_highlight_languages.begin(); |
-
|
rcd46e34
|
rfb634fc
|
|
| 95 | 95 | userlist_width(entry.get_value<unsigned int>("userlist_width", 150)), |
| 96 | 96 | show_toolbar(entry.get_value<bool>("show_toolbar", true)), |
| 97 | | show_statusbar(entry.get_value<bool>("show_statusbar", true)) |
| | 97 | show_statusbar(entry.get_value<bool>("show_statusbar", true)), |
| | 98 | show_browser(entry.get_value<bool>("show_browser", true)), |
| | 99 | show_userlist(entry.get_value<bool>("show_userlist", true)) |
| 98 | 100 | { |
| 99 | 101 | } |
| … |
… |
|
| 113 | 115 | entry.set_value("show_toolbar", show_toolbar); |
| 114 | 116 | entry.set_value("show_statusbar", show_statusbar); |
| | 117 | entry.set_value("show_browser", show_browser); |
| | 118 | entry.set_value("show_userlist", show_userlist); |
| 115 | 119 | } |
| 116 | 120 | |
-
|
rc159f45
|
rfb634fc
|
|
| 22 | 22 | #include "core/iconmanager.hpp" |
| 23 | 23 | #include "core/noteplugin.hpp" |
| | 24 | #include "core/closableframe.hpp" |
| | 25 | |
| | 26 | #include <gtkmm/frame.h> |
| 24 | 27 | |
| 25 | 28 | Gobby::Window::Window(const IconManager& icon_mgr, Config& config): |
| … |
… |
|
| 48 | 51 | m_browser.show(); |
| 49 | 52 | m_folder.show(); |
| 50 | | m_statusbar.show(); |
| 51 | 53 | |
| 52 | 54 | // Build UI |
| 53 | 55 | add_accel_group(m_header.get_accel_group() ); |
| 54 | 56 | |
| 55 | | m_frame_browser.set_shadow_type(Gtk::SHADOW_IN); |
| 56 | | m_frame_browser.add(m_browser); |
| 57 | | m_frame_browser.show(); |
| 58 | | m_frame_text.set_shadow_type(Gtk::SHADOW_IN); |
| 59 | | m_frame_text.add(m_folder); |
| 60 | | m_frame_text.show(); |
| | 57 | Gtk::Frame* frame_browser = Gtk::manage( |
| | 58 | new ClosableFrame(m_preferences.appearance.show_browser)); |
| | 59 | frame_browser->set_shadow_type(Gtk::SHADOW_IN); |
| | 60 | frame_browser->add(m_browser); |
| | 61 | // frame_browser manages visibility itself |
| 61 | 62 | |
| 62 | | m_paned.pack1(m_frame_browser, false, false); |
| 63 | | m_paned.pack2(m_frame_text, true, false); |
| | 63 | Gtk::Frame* frame_text = Gtk::manage(new Gtk::Frame); |
| | 64 | frame_text->set_shadow_type(Gtk::SHADOW_IN); |
| | 65 | frame_text->add(m_folder); |
| | 66 | frame_text->show(); |
| | 67 | |
| | 68 | m_paned.pack1(*frame_browser, false, false); |
| | 69 | m_paned.pack2(*frame_text, true, false); |
| 64 | 70 | m_paned.show(); |
| 65 | 71 | |