Inkscape
Vector Graphics Editor
Loading...
Searching...
No Matches
Inkscape::UI::Dialog::LayerPropertiesDialog Class Referencefinal

#include <layer-properties.h>

Inheritance diagram for Inkscape::UI::Dialog::LayerPropertiesDialog:

Classes

struct  ModelColumns
 
struct  PositionDropdownColumns
 

Static Public Member Functions

static void showRename (SPDesktop *desktop, SPObject *layer)
 
static void showCreate (SPDesktop *desktop, SPObject *layer)
 
static void showMove (SPDesktop *desktop, SPObject *layer)
 

Private Member Functions

 LayerPropertiesDialog (LayerPropertiesDialogType type)
 
 ~LayerPropertiesDialog () override
 
void _setDesktop (SPDesktop *desktop)
 
void _setLayer (SPObject *layer)
 
void _apply ()
 Performs an action depending on the type of the dialog.
 
void _setup_position_controls ()
 Sets up the combo box for choosing the relative position of the new layer.
 
void _setup_layers_controls ()
 Sets up the tree view of current layers.
 
void _prepareLabelRenderer (Gtk::TreeModel::const_iterator const &iter)
 Formats the label for a given layer row.
 
void _addLayer (SPObject *layer, Gtk::TreeModel::Row *parentRow, SPObject *target, int level)
 Inserts the new layer into the document.
 
SPObject_selectedLayer ()
 
bool on_key_pressed (Gtk::EventControllerKey const &controller, unsigned keyval, unsigned keycode, Gdk::ModifierType state)
 
Gtk::EventSequenceState on_click_pressed (int n_press, double x, double y)
 
void _doCreate ()
 Creates a new layer based on the input entered in the dialog window.
 
void _doMove ()
 Moves selection to the chosen layer.
 
void _doRename ()
 Renames a layer based on the user input in the dialog window.
 
void _setup ()
 Sets up the dialog depending on its type.
 

Static Private Member Functions

static void _showDialog (LayerPropertiesDialogType type, SPDesktop *desktop, SPObject *layer)
 Static member function which displays a modal dialog of the given type.
 

Private Attributes

LayerPropertiesDialogType _type = LayerPropertiesDialogType::NONE
 
SPDesktop_desktop = nullptr
 
SPObject_layer = nullptr
 
Gtk::Label _layer_name_label
 
Gtk::Entry _layer_name_entry
 
Gtk::Label _layer_position_label
 
Gtk::CheckButton _layer_position_radio [3]
 
Gtk::Grid _layout_table
 
bool _position_visible = false
 
Gtk::Box _mainbox
 
Gtk::Box _buttonbox
 
Gtk::TreeView _tree
 
ModelColumns _model
 
Glib::RefPtr< Gtk::TreeStore > _store
 
Gtk::ScrolledWindow _scroller
 
PositionDropdownColumns _dropdown_columns
 
Gtk::CellRendererText _label_renderer
 
Gtk::Button _close_button
 
Gtk::Button _apply_button
 

Detailed Description

Definition at line 47 of file layer-properties.h.

Constructor & Destructor Documentation

◆ LayerPropertiesDialog()

Inkscape::UI::Dialog::LayerPropertiesDialog::LayerPropertiesDialog ( LayerPropertiesDialogType  type)
explicitprivate

◆ ~LayerPropertiesDialog()

Inkscape::UI::Dialog::LayerPropertiesDialog::~LayerPropertiesDialog ( )
overrideprivate

Definition at line 84 of file layer-properties.cpp.

References _setDesktop(), and _setLayer().

Member Function Documentation

◆ _addLayer()

◆ _apply()

void Inkscape::UI::Dialog::LayerPropertiesDialog::_apply ( )
private

◆ _doCreate()

◆ _doMove()

void Inkscape::UI::Dialog::LayerPropertiesDialog::_doMove ( )
private

Moves selection to the chosen layer.

Definition at line 164 of file layer-properties.cpp.

References _desktop, _selectedLayer(), Inkscape::DocumentUndo::done(), SPDesktop::getDocument(), SPDesktop::getSelection(), and Inkscape::ObjectSet::toLayer().

Referenced by _apply().

◆ _doRename()

◆ _prepareLabelRenderer()

void Inkscape::UI::Dialog::LayerPropertiesDialog::_prepareLabelRenderer ( Gtk::TreeModel::const_iterator const &  iter)
private

Formats the label for a given layer row.

Definition at line 402 of file layer-properties.cpp.

References _dropdown_columns, _label_renderer, and Inkscape::UI::Dialog::LayerPropertiesDialog::PositionDropdownColumns::name.

◆ _selectedLayer()

SPObject * Inkscape::UI::Dialog::LayerPropertiesDialog::_selectedLayer ( )
private

◆ _setDesktop()

void Inkscape::UI::Dialog::LayerPropertiesDialog::_setDesktop ( SPDesktop desktop)
inlineprivate

Definition at line 118 of file layer-properties.h.

References _desktop, and desktop.

Referenced by ~LayerPropertiesDialog().

◆ _setLayer()

void Inkscape::UI::Dialog::LayerPropertiesDialog::_setLayer ( SPObject layer)
private

Definition at line 407 of file layer-properties.cpp.

References _layer, sp_object_ref(), and sp_object_unref().

Referenced by ~LayerPropertiesDialog().

◆ _setup()

◆ _setup_layers_controls()

◆ _setup_position_controls()

void Inkscape::UI::Dialog::LayerPropertiesDialog::_setup_position_controls ( )
private

◆ _showDialog()

void Inkscape::UI::Dialog::LayerPropertiesDialog::_showDialog ( LayerPropertiesDialogType  type,
SPDesktop desktop,
SPObject layer 
)
staticprivate

Static member function which displays a modal dialog of the given type.

Definition at line 91 of file layer-properties.cpp.

References desktop, and SPDesktop::setWindowTransient().

Referenced by showCreate(), showMove(), and showRename().

◆ on_click_pressed()

Gtk::EventSequenceState Inkscape::UI::Dialog::LayerPropertiesDialog::on_click_pressed ( int  n_press,
double  x,
double  y 
)
private

Definition at line 391 of file layer-properties.cpp.

References _apply().

Referenced by _setup_layers_controls().

◆ on_key_pressed()

bool Inkscape::UI::Dialog::LayerPropertiesDialog::on_key_pressed ( Gtk::EventControllerKey const &  controller,
unsigned  keyval,
unsigned  keycode,
Gdk::ModifierType  state 
)
private

Definition at line 377 of file layer-properties.cpp.

References _apply(), and Inkscape::UI::Tools::get_latin_keyval().

Referenced by _setup_layers_controls().

◆ showCreate()

static void Inkscape::UI::Dialog::LayerPropertiesDialog::showCreate ( SPDesktop desktop,
SPObject layer 
)
inlinestatic

Definition at line 53 of file layer-properties.h.

References _showDialog(), Inkscape::UI::Dialog::CREATE, and desktop.

Referenced by layer_new().

◆ showMove()

static void Inkscape::UI::Dialog::LayerPropertiesDialog::showMove ( SPDesktop desktop,
SPObject layer 
)
inlinestatic

Definition at line 56 of file layer-properties.h.

References _showDialog(), desktop, and Inkscape::UI::Dialog::MOVE.

Referenced by selection_move_to_layer().

◆ showRename()

static void Inkscape::UI::Dialog::LayerPropertiesDialog::showRename ( SPDesktop desktop,
SPObject layer 
)
inlinestatic

Definition at line 50 of file layer-properties.h.

References _showDialog(), desktop, and Inkscape::UI::Dialog::RENAME.

Referenced by layer_rename().

Member Data Documentation

◆ _apply_button

Gtk::Button Inkscape::UI::Dialog::LayerPropertiesDialog::_apply_button
private

Definition at line 116 of file layer-properties.h.

Referenced by _setup(), and LayerPropertiesDialog().

◆ _buttonbox

Gtk::Box Inkscape::UI::Dialog::LayerPropertiesDialog::_buttonbox
private

Definition at line 105 of file layer-properties.h.

Referenced by LayerPropertiesDialog().

◆ _close_button

Gtk::Button Inkscape::UI::Dialog::LayerPropertiesDialog::_close_button
private

Definition at line 115 of file layer-properties.h.

Referenced by LayerPropertiesDialog().

◆ _desktop

SPDesktop* Inkscape::UI::Dialog::LayerPropertiesDialog::_desktop = nullptr
private

◆ _dropdown_columns

PositionDropdownColumns Inkscape::UI::Dialog::LayerPropertiesDialog::_dropdown_columns
private

Definition at line 112 of file layer-properties.h.

Referenced by _prepareLabelRenderer().

◆ _label_renderer

Gtk::CellRendererText Inkscape::UI::Dialog::LayerPropertiesDialog::_label_renderer
private

Definition at line 113 of file layer-properties.h.

Referenced by _prepareLabelRenderer().

◆ _layer

SPObject* Inkscape::UI::Dialog::LayerPropertiesDialog::_layer = nullptr
private

Definition at line 66 of file layer-properties.h.

Referenced by _doCreate(), _setLayer(), and _setup_position_controls().

◆ _layer_name_entry

Gtk::Entry Inkscape::UI::Dialog::LayerPropertiesDialog::_layer_name_entry
private

◆ _layer_name_label

Gtk::Label Inkscape::UI::Dialog::LayerPropertiesDialog::_layer_name_label
private

Definition at line 80 of file layer-properties.h.

Referenced by _setup_layers_controls(), and LayerPropertiesDialog().

◆ _layer_position_label

Gtk::Label Inkscape::UI::Dialog::LayerPropertiesDialog::_layer_position_label
private

Definition at line 82 of file layer-properties.h.

Referenced by _setup_position_controls().

◆ _layer_position_radio

Gtk::CheckButton Inkscape::UI::Dialog::LayerPropertiesDialog::_layer_position_radio[3]
private

Definition at line 83 of file layer-properties.h.

Referenced by _doCreate(), and _setup_position_controls().

◆ _layout_table

Gtk::Grid Inkscape::UI::Dialog::LayerPropertiesDialog::_layout_table
private

◆ _mainbox

Gtk::Box Inkscape::UI::Dialog::LayerPropertiesDialog::_mainbox
private

Definition at line 104 of file layer-properties.h.

Referenced by LayerPropertiesDialog().

◆ _model

ModelColumns Inkscape::UI::Dialog::LayerPropertiesDialog::_model
private

Definition at line 108 of file layer-properties.h.

Referenced by _addLayer(), _selectedLayer(), and _setup_layers_controls().

◆ _position_visible

bool Inkscape::UI::Dialog::LayerPropertiesDialog::_position_visible = false
private

Definition at line 86 of file layer-properties.h.

Referenced by _doCreate(), and _setup_position_controls().

◆ _scroller

Gtk::ScrolledWindow Inkscape::UI::Dialog::LayerPropertiesDialog::_scroller
private

Definition at line 110 of file layer-properties.h.

Referenced by _setup_layers_controls().

◆ _store

Glib::RefPtr<Gtk::TreeStore> Inkscape::UI::Dialog::LayerPropertiesDialog::_store
private

Definition at line 109 of file layer-properties.h.

Referenced by _addLayer(), and _setup_layers_controls().

◆ _tree

Gtk::TreeView Inkscape::UI::Dialog::LayerPropertiesDialog::_tree
private

Definition at line 107 of file layer-properties.h.

Referenced by _addLayer(), _selectedLayer(), and _setup_layers_controls().

◆ _type

LayerPropertiesDialogType Inkscape::UI::Dialog::LayerPropertiesDialog::_type = LayerPropertiesDialogType::NONE
private

Definition at line 64 of file layer-properties.h.

Referenced by _apply(), and _setup().


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