Inkscape
Vector Graphics Editor
|
A widget that wraps a Gtk::Notebook with dialogs as pages. More...
#include <dialog-notebook.h>
Public Member Functions | |
DialogNotebook (DialogContainer *container) | |
DialogNotebook constructor. | |
~DialogNotebook () override | |
void | add_page (Gtk::Widget &page) |
Adds a widget as a new page with a tab. | |
void | move_page (Gtk::Widget &page) |
Moves a page from a different notebook to this one. | |
void | select_page (Gtk::Widget &page) |
Gtk::Widget * | get_page (int position) |
Gtk::Notebook * | get_notebook () |
DialogContainer * | get_container () |
void | close_tab (Gtk::Widget *page) |
Callback to close the current active tab. | |
void | close_notebook () |
Shutdown callback - delete the parent DialogMultipaned before destructing. | |
DialogWindow * | pop_tab (Gtk::Widget *page) |
Move the current active tab to a floating window. | |
void | dock_current_tab (DialogContainer::DockLocation location) |
Gtk::ScrolledWindow * | get_scrolledwindow (Gtk::Widget &page) |
Gtk::ScrolledWindow * | get_current_scrolledwindow (bool skip_scroll_provider) |
Set provide scroll. | |
void | set_requested_height (int height) |
DialogWindow * | float_tab (Gtk::Widget &page) |
Static Public Member Functions | |
static Gtk::Notebook * | get_page_notebook (Gtk::Widget &page) |
Private Member Functions | |
void | add_notebook_page (Gtk::Widget &page, int position) |
void | move_tab_from (DialogNotebook &source, Gtk::Widget &page, int position) |
void | build_docking_menu (UI::Widget::PopoverMenu &menu) |
void | build_dialog_menu (UI::Widget::PopoverMenu &menu) |
void | add_highlight_header () |
void | remove_highlight_header () |
void | on_page_added (Gtk::Widget *page, int page_num) |
Signal handler to update dialog list when adding a page. | |
void | on_page_removed (Gtk::Widget *page, int page_num) |
Signal handler to update dialog list when removing a page. | |
void | size_allocate_vfunc (int width, int height, int baseline) final |
void | on_size_allocate_scroll (int width) |
We need to remove the scrollbar to snap a whole DialogNotebook to width 0. | |
void | on_page_switch (Gtk::Widget *page, guint page_number) |
bool | on_scroll_event (double dx, double dy) |
bool | provide_scroll (Gtk::Widget &page) |
get provide scroll | |
void | change_page (size_t pagenum) |
Helper method that change the page. | |
void | measure_vfunc (Gtk::Orientation orientation, int for_size, int &min, int &nat, int &min_baseline, int &nat_baseline) const override |
Private Attributes | |
DialogContainer * | _container |
UI::Widget::PopoverMenu | _menu_dialogs {Gtk::PositionType::BOTTOM, true} |
UI::Widget::PopoverMenu | _menu_dock {Gtk::PositionType::BOTTOM} |
UI::Widget::PopoverMenu | _menu_tab_ctx {Gtk::PositionType::BOTTOM, true} |
Gtk::Notebook | _notebook |
UI::Widget::TabStrip | _tabs |
Gtk::Box | _content {Gtk::Orientation::VERTICAL} |
bool | _detaching_duplicate = false |
std::vector< sigc::scoped_connection > | _conn |
std::vector< sigc::scoped_connection > | _connmenu |
PrefObserver | _label_pref |
PrefObserver | _tabclose_pref |
int | _natural_height = 0 |
Static Private Attributes | |
static std::list< DialogNotebook * > | _instances |
A widget that wraps a Gtk::Notebook with dialogs as pages.
Its tabs are hidden. We use TabStrip to provide tabs for switching pages.
A notebook is fixed to a specific DialogContainer which manages the dialogs inside the notebook.
Definition at line 61 of file dialog-notebook.h.
Inkscape::UI::Dialog::DialogNotebook::DialogNotebook | ( | DialogContainer * | container | ) |
DialogNotebook constructor.
container | the parent DialogContainer of the notebook. |
Definition at line 69 of file dialog-notebook.cpp.
References _conn, _content, _instances, _label_pref, _menu_dialogs, _menu_dock, _menu_tab_ctx, _notebook, _tabclose_pref, _tabs, Inkscape::UI::Widget::TabStrip::ActiveOnly, Inkscape::UI::Dialog::DialogMultipaned::add_drop_zone_highlight_instances(), Inkscape::UI::Widget::TabStrip::Always, build_dialog_menu(), build_docking_menu(), close_tab(), Inkscape::UI::Dialog::dialog_notebook_id(), float_tab(), Inkscape::Preferences::get(), Inkscape::UI::Widget::TabStrip::get_tab_position(), index, move_tab_from(), Inkscape::UI::Widget::TabStrip::Never, on_page_added(), on_page_removed(), on_page_switch(), on_scroll_event(), page, PREFS_NOTEBOOK_LABELS_ACTIVE, PREFS_NOTEBOOK_LABELS_AUTO, Inkscape::UI::Dialog::DialogMultipaned::remove_drop_zone_highlight_instances(), Inkscape::UI::Widget::TabStrip::select_tab(), Inkscape::UI::Widget::TabStrip::set_new_tab_popup(), Inkscape::UI::Widget::TabStrip::set_show_close_button(), Inkscape::UI::Widget::TabStrip::set_show_labels(), Inkscape::UI::Widget::TabStrip::set_tabs_context_popup(), Inkscape::UI::Widget::TabStrip::signal_close_tab(), Inkscape::UI::Widget::TabStrip::signal_dnd_begin(), Inkscape::UI::Widget::TabStrip::signal_dnd_end(), Inkscape::UI::Widget::TabStrip::signal_float_tab(), Inkscape::UI::Widget::TabStrip::signal_move_tab(), Inkscape::UI::Widget::TabStrip::signal_select_tab(), and Inkscape::UI::Widget::TabStrip::signal_tab_rearranged().
|
override |
Definition at line 279 of file dialog-notebook.cpp.
|
private |
Definition at line 295 of file dialog-notebook.cpp.
|
private |
Definition at line 385 of file dialog-notebook.cpp.
References page.
void Inkscape::UI::Dialog::DialogNotebook::add_page | ( | Gtk::Widget & | page | ) |
Adds a widget as a new page with a tab.
Definition at line 348 of file dialog-notebook.cpp.
References Inkscape::UI::_continue, child, Inkscape::UI::for_each_child(), and page.
Referenced by Inkscape::UI::Dialog::DialogContainer::new_dialog().
|
private |
Definition at line 247 of file dialog-notebook.cpp.
References _container, builder, data, desktop, DialogData::Diagnostics, dialog_categories, get_dialog_data_list(), SPDesktop::getContainer(), key, Inkscape::UI::Dialog::DialogManager::should_open_floating(), and Inkscape::UI::Dialog::DialogManager::singleton().
Referenced by DialogNotebook().
|
private |
Definition at line 197 of file dialog-notebook.cpp.
References _conn, Inkscape::UI::Widget::PopoverMenu::attach(), Inkscape::Preferences::get(), and item.
Referenced by DialogNotebook().
|
private |
Helper method that change the page.
Definition at line 691 of file dialog-notebook.cpp.
void Inkscape::UI::Dialog::DialogNotebook::close_notebook | ( | ) |
Shutdown callback - delete the parent DialogMultipaned before destructing.
Definition at line 460 of file dialog-notebook.cpp.
References Inkscape::UI::Dialog::DialogMultipaned::remove().
Referenced by Inkscape::UI::Dialog::DialogContainer::dock_dialog(), and move_tab_from().
void Inkscape::UI::Dialog::DialogNotebook::close_tab | ( | Gtk::Widget * | page | ) |
Callback to close the current active tab.
Definition at line 430 of file dialog-notebook.cpp.
References page.
Referenced by DialogNotebook().
void Inkscape::UI::Dialog::DialogNotebook::dock_current_tab | ( | DialogContainer::DockLocation | location | ) |
Definition at line 539 of file dialog-notebook.cpp.
References page.
DialogWindow * Inkscape::UI::Dialog::DialogNotebook::float_tab | ( | Gtk::Widget & | page | ) |
Definition at line 505 of file dialog-notebook.cpp.
References Inkscape::UI::Dialog::DialogWindow::get_inkscape_window(), and page.
Referenced by DialogNotebook().
|
inline |
Definition at line 75 of file dialog-notebook.h.
References _container.
Gtk::ScrolledWindow * Inkscape::UI::Dialog::DialogNotebook::get_current_scrolledwindow | ( | bool | skip_scroll_provider | ) |
|
inline |
Definition at line 74 of file dialog-notebook.h.
References _notebook.
Referenced by Inkscape::UI::Dialog::DialogContainer::dock_dialog(), Inkscape::UI::Dialog::get_notebook_dialogs(), and Inkscape::UI::Dialog::DialogContainer::load_container_state().
Gtk::Widget * Inkscape::UI::Dialog::DialogNotebook::get_page | ( | int | position | ) |
Definition at line 491 of file dialog-notebook.cpp.
Referenced by Inkscape::UI::Dialog::find_dialog_page().
|
static |
Definition at line 495 of file dialog-notebook.cpp.
Gtk::ScrolledWindow * Inkscape::UI::Dialog::DialogNotebook::get_scrolledwindow | ( | Gtk::Widget & | page | ) |
Definition at line 320 of file dialog-notebook.cpp.
References Inkscape::UI::get_children(), and page.
|
overrideprivate |
Definition at line 696 of file dialog-notebook.cpp.
void Inkscape::UI::Dialog::DialogNotebook::move_page | ( | Gtk::Widget & | page | ) |
Moves a page from a different notebook to this one.
Definition at line 395 of file dialog-notebook.cpp.
References page.
Referenced by Inkscape::UI::Dialog::DialogContainer::dock_dialog().
|
private |
Definition at line 471 of file dialog-notebook.cpp.
References _notebook, close_notebook(), and page.
Referenced by DialogNotebook().
|
private |
Signal handler to update dialog list when adding a page.
Definition at line 558 of file dialog-notebook.cpp.
References Inkscape::UI::Dialog::DialogBase::blink(), and page.
Referenced by DialogNotebook().
|
private |
Signal handler to update dialog list when removing a page.
When adding a dialog in a notebooks header zone of the same type as an existing one, we remove it immediately, which triggers a call to this method. We use _detaching_duplicate
to prevent reemoving the initial dialog.
Definition at line 594 of file dialog-notebook.cpp.
References page.
Referenced by DialogNotebook().
|
private |
Definition at line 664 of file dialog-notebook.cpp.
References page.
Referenced by DialogNotebook().
|
private |
Definition at line 668 of file dialog-notebook.cpp.
Referenced by DialogNotebook().
|
private |
We need to remove the scrollbar to snap a whole DialogNotebook to width 0.
Definition at line 627 of file dialog-notebook.cpp.
References Inkscape::UI::_break, Inkscape::UI::_continue, Inkscape::UI::for_each_page(), height, and page.
DialogWindow * Inkscape::UI::Dialog::DialogNotebook::pop_tab | ( | Gtk::Widget * | page | ) |
Move the current active tab to a floating window.
Definition at line 525 of file dialog-notebook.cpp.
References page.
|
private |
get provide scroll
Definition at line 308 of file dialog-notebook.cpp.
References data, get_dialog_data(), page, and PROVIDE.
|
private |
Definition at line 300 of file dialog-notebook.cpp.
void Inkscape::UI::Dialog::DialogNotebook::select_page | ( | Gtk::Widget & | page | ) |
Definition at line 420 of file dialog-notebook.cpp.
References page.
Referenced by Inkscape::UI::Dialog::DialogContainer::dock_dialog().
void Inkscape::UI::Dialog::DialogNotebook::set_requested_height | ( | int | height | ) |
Definition at line 705 of file dialog-notebook.cpp.
References height.
Referenced by Inkscape::UI::Dialog::DialogContainer::load_container_state().
|
finalprivate |
Definition at line 616 of file dialog-notebook.cpp.
|
private |
Definition at line 106 of file dialog-notebook.h.
Referenced by build_docking_menu(), and DialogNotebook().
|
private |
Definition at line 107 of file dialog-notebook.h.
|
private |
Definition at line 89 of file dialog-notebook.h.
Referenced by build_dialog_menu(), and get_container().
|
private |
Definition at line 95 of file dialog-notebook.h.
Referenced by DialogNotebook().
|
private |
Definition at line 105 of file dialog-notebook.h.
|
staticprivate |
Definition at line 111 of file dialog-notebook.h.
Referenced by DialogNotebook().
|
private |
Definition at line 108 of file dialog-notebook.h.
Referenced by DialogNotebook().
|
private |
Definition at line 90 of file dialog-notebook.h.
Referenced by DialogNotebook().
|
private |
Definition at line 91 of file dialog-notebook.h.
Referenced by DialogNotebook().
|
private |
Definition at line 92 of file dialog-notebook.h.
Referenced by DialogNotebook().
|
private |
Definition at line 127 of file dialog-notebook.h.
|
private |
Definition at line 93 of file dialog-notebook.h.
Referenced by DialogNotebook(), get_notebook(), and move_tab_from().
|
private |
Definition at line 109 of file dialog-notebook.h.
Referenced by DialogNotebook().
|
private |
Definition at line 94 of file dialog-notebook.h.
Referenced by DialogNotebook().