Inkscape
Vector Graphics Editor
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages Concepts
Inkscape::UI::Dialog::DialogNotebook Class Reference

A widget that wraps a Gtk::Notebook with dialogs as pages. More...

#include <dialog-notebook.h>

Inheritance diagram for Inkscape::UI::Dialog::DialogNotebook:

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 ()
 
DialogContainerget_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.
 
DialogWindowpop_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)
 
DialogWindowfloat_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
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ DialogNotebook()

Inkscape::UI::Dialog::DialogNotebook::DialogNotebook ( DialogContainer container)

DialogNotebook constructor.

Parameters
containerthe 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().

◆ ~DialogNotebook()

Inkscape::UI::Dialog::DialogNotebook::~DialogNotebook ( )
override

Definition at line 279 of file dialog-notebook.cpp.

Member Function Documentation

◆ add_highlight_header()

void Inkscape::UI::Dialog::DialogNotebook::add_highlight_header ( )
private

Definition at line 295 of file dialog-notebook.cpp.

◆ add_notebook_page()

void Inkscape::UI::Dialog::DialogNotebook::add_notebook_page ( Gtk::Widget &  page,
int  position 
)
private

Definition at line 385 of file dialog-notebook.cpp.

References page.

◆ add_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().

◆ build_dialog_menu()

◆ build_docking_menu()

void Inkscape::UI::Dialog::DialogNotebook::build_docking_menu ( UI::Widget::PopoverMenu menu)
private

◆ change_page()

void Inkscape::UI::Dialog::DialogNotebook::change_page ( size_t  pagenum)
private

Helper method that change the page.

Definition at line 691 of file dialog-notebook.cpp.

◆ close_notebook()

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().

◆ close_tab()

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().

◆ dock_current_tab()

void Inkscape::UI::Dialog::DialogNotebook::dock_current_tab ( DialogContainer::DockLocation  location)

Definition at line 539 of file dialog-notebook.cpp.

References page.

◆ float_tab()

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().

◆ get_container()

DialogContainer * Inkscape::UI::Dialog::DialogNotebook::get_container ( )
inline

Definition at line 75 of file dialog-notebook.h.

References _container.

◆ get_current_scrolledwindow()

Gtk::ScrolledWindow * Inkscape::UI::Dialog::DialogNotebook::get_current_scrolledwindow ( bool  skip_scroll_provider)

Set provide scroll.

Definition at line 333 of file dialog-notebook.cpp.

References page.

◆ get_notebook()

Gtk::Notebook * Inkscape::UI::Dialog::DialogNotebook::get_notebook ( )
inline

◆ get_page()

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().

◆ get_page_notebook()

Gtk::Notebook * Inkscape::UI::Dialog::DialogNotebook::get_page_notebook ( Gtk::Widget &  page)
static

Definition at line 495 of file dialog-notebook.cpp.

References page, and parent.

◆ get_scrolledwindow()

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.

◆ measure_vfunc()

void Inkscape::UI::Dialog::DialogNotebook::measure_vfunc ( Gtk::Orientation  orientation,
int  for_size,
int &  min,
int &  nat,
int &  min_baseline,
int &  nat_baseline 
) const
overrideprivate

Definition at line 696 of file dialog-notebook.cpp.

◆ move_page()

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().

◆ move_tab_from()

void Inkscape::UI::Dialog::DialogNotebook::move_tab_from ( DialogNotebook source,
Gtk::Widget &  page,
int  position 
)
private

Definition at line 471 of file dialog-notebook.cpp.

References _notebook, close_notebook(), and page.

Referenced by DialogNotebook().

◆ on_page_added()

void Inkscape::UI::Dialog::DialogNotebook::on_page_added ( Gtk::Widget *  page,
int  page_num 
)
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().

◆ on_page_removed()

void Inkscape::UI::Dialog::DialogNotebook::on_page_removed ( Gtk::Widget *  page,
int  page_num 
)
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().

◆ on_page_switch()

void Inkscape::UI::Dialog::DialogNotebook::on_page_switch ( Gtk::Widget *  page,
guint  page_number 
)
private

Definition at line 664 of file dialog-notebook.cpp.

References page.

Referenced by DialogNotebook().

◆ on_scroll_event()

bool Inkscape::UI::Dialog::DialogNotebook::on_scroll_event ( double  dx,
double  dy 
)
private

Definition at line 668 of file dialog-notebook.cpp.

Referenced by DialogNotebook().

◆ on_size_allocate_scroll()

void Inkscape::UI::Dialog::DialogNotebook::on_size_allocate_scroll ( int  width)
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.

◆ pop_tab()

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.

◆ provide_scroll()

bool Inkscape::UI::Dialog::DialogNotebook::provide_scroll ( Gtk::Widget &  page)
private

get provide scroll

Definition at line 308 of file dialog-notebook.cpp.

References data, get_dialog_data(), page, and PROVIDE.

◆ remove_highlight_header()

void Inkscape::UI::Dialog::DialogNotebook::remove_highlight_header ( )
private

Definition at line 300 of file dialog-notebook.cpp.

◆ select_page()

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().

◆ set_requested_height()

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().

◆ size_allocate_vfunc()

void Inkscape::UI::Dialog::DialogNotebook::size_allocate_vfunc ( int  width,
int  height,
int  baseline 
)
finalprivate

Definition at line 616 of file dialog-notebook.cpp.

References height, and width.

Member Data Documentation

◆ _conn

std::vector<sigc::scoped_connection> Inkscape::UI::Dialog::DialogNotebook::_conn
private

Definition at line 106 of file dialog-notebook.h.

Referenced by build_docking_menu(), and DialogNotebook().

◆ _connmenu

std::vector<sigc::scoped_connection> Inkscape::UI::Dialog::DialogNotebook::_connmenu
private

Definition at line 107 of file dialog-notebook.h.

◆ _container

DialogContainer* Inkscape::UI::Dialog::DialogNotebook::_container
private

Definition at line 89 of file dialog-notebook.h.

Referenced by build_dialog_menu(), and get_container().

◆ _content

Gtk::Box Inkscape::UI::Dialog::DialogNotebook::_content {Gtk::Orientation::VERTICAL}
private

Definition at line 95 of file dialog-notebook.h.

Referenced by DialogNotebook().

◆ _detaching_duplicate

bool Inkscape::UI::Dialog::DialogNotebook::_detaching_duplicate = false
private

Definition at line 105 of file dialog-notebook.h.

◆ _instances

std::list< DialogNotebook * > Inkscape::UI::Dialog::DialogNotebook::_instances
staticprivate

Definition at line 111 of file dialog-notebook.h.

Referenced by DialogNotebook().

◆ _label_pref

PrefObserver Inkscape::UI::Dialog::DialogNotebook::_label_pref
private

Definition at line 108 of file dialog-notebook.h.

Referenced by DialogNotebook().

◆ _menu_dialogs

UI::Widget::PopoverMenu Inkscape::UI::Dialog::DialogNotebook::_menu_dialogs {Gtk::PositionType::BOTTOM, true}
private

Definition at line 90 of file dialog-notebook.h.

Referenced by DialogNotebook().

◆ _menu_dock

UI::Widget::PopoverMenu Inkscape::UI::Dialog::DialogNotebook::_menu_dock {Gtk::PositionType::BOTTOM}
private

Definition at line 91 of file dialog-notebook.h.

Referenced by DialogNotebook().

◆ _menu_tab_ctx

UI::Widget::PopoverMenu Inkscape::UI::Dialog::DialogNotebook::_menu_tab_ctx {Gtk::PositionType::BOTTOM, true}
private

Definition at line 92 of file dialog-notebook.h.

Referenced by DialogNotebook().

◆ _natural_height

int Inkscape::UI::Dialog::DialogNotebook::_natural_height = 0
private

Definition at line 127 of file dialog-notebook.h.

◆ _notebook

Gtk::Notebook Inkscape::UI::Dialog::DialogNotebook::_notebook
private

Definition at line 93 of file dialog-notebook.h.

Referenced by DialogNotebook(), get_notebook(), and move_tab_from().

◆ _tabclose_pref

PrefObserver Inkscape::UI::Dialog::DialogNotebook::_tabclose_pref
private

Definition at line 109 of file dialog-notebook.h.

Referenced by DialogNotebook().

◆ _tabs

UI::Widget::TabStrip Inkscape::UI::Dialog::DialogNotebook::_tabs
private

Definition at line 94 of file dialog-notebook.h.

Referenced by DialogNotebook().


The documentation for this class was generated from the following files: