summaryrefslogtreecommitdiffstats
path: root/src/ui
diff options
context:
space:
mode:
authorJabiertxo Arraiza Cenoz <jtx@jtx.markerlab.es>2018-07-25 09:46:37 +0000
committerJabiertxo Arraiza Cenoz <jtx@jtx.markerlab.es>2018-07-25 09:46:37 +0000
commit3052c39e53adfe7397987f91f7519d91392ea27f (patch)
tree37feab56ffcb7a681b43a3c0b8bd18737595ab3c /src/ui
parentFix a compiling bug (diff)
downloadinkscape-3052c39e53adfe7397987f91f7519d91392ea27f.tar.gz
inkscape-3052c39e53adfe7397987f91f7519d91392ea27f.zip
Fix codding style
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/widget/anchor-selector.cpp77
-rw-r--r--src/ui/widget/preferences-widget.h8
2 files changed, 42 insertions, 43 deletions
diff --git a/src/ui/widget/anchor-selector.cpp b/src/ui/widget/anchor-selector.cpp
index 0873f9a84..ededc84e3 100644
--- a/src/ui/widget/anchor-selector.cpp
+++ b/src/ui/widget/anchor-selector.cpp
@@ -21,38 +21,38 @@ void AnchorSelector::setupButton(const Glib::ustring& icon, Gtk::ToggleButton& b
buttonIcon->show();
button.set_relief(Gtk::RELIEF_NONE);
- button.show();
- button.add(*buttonIcon);
- button.set_can_focus(false);
+ button.show();
+ button.add(*buttonIcon);
+ button.set_can_focus(false);
}
AnchorSelector::AnchorSelector()
: _container()
{
set_halign(Gtk::ALIGN_CENTER);
- setupButton(INKSCAPE_ICON("boundingbox_top_left"), _buttons[0]);
- setupButton(INKSCAPE_ICON("boundingbox_top"), _buttons[1]);
- setupButton(INKSCAPE_ICON("boundingbox_top_right"), _buttons[2]);
- setupButton(INKSCAPE_ICON("boundingbox_left"), _buttons[3]);
- setupButton(INKSCAPE_ICON("boundingbox_center"), _buttons[4]);
- setupButton(INKSCAPE_ICON("boundingbox_right"), _buttons[5]);
- setupButton(INKSCAPE_ICON("boundingbox_bottom_left"), _buttons[6]);
- setupButton(INKSCAPE_ICON("boundingbox_bottom"), _buttons[7]);
- setupButton(INKSCAPE_ICON("boundingbox_bottom_right"), _buttons[8]);
+ setupButton(INKSCAPE_ICON("boundingbox_top_left"), _buttons[0]);
+ setupButton(INKSCAPE_ICON("boundingbox_top"), _buttons[1]);
+ setupButton(INKSCAPE_ICON("boundingbox_top_right"), _buttons[2]);
+ setupButton(INKSCAPE_ICON("boundingbox_left"), _buttons[3]);
+ setupButton(INKSCAPE_ICON("boundingbox_center"), _buttons[4]);
+ setupButton(INKSCAPE_ICON("boundingbox_right"), _buttons[5]);
+ setupButton(INKSCAPE_ICON("boundingbox_bottom_left"), _buttons[6]);
+ setupButton(INKSCAPE_ICON("boundingbox_bottom"), _buttons[7]);
+ setupButton(INKSCAPE_ICON("boundingbox_bottom_right"), _buttons[8]);
- _container.set_row_homogeneous();
- _container.set_column_homogeneous(true);
+ _container.set_row_homogeneous();
+ _container.set_column_homogeneous(true);
- for(int i = 0; i < 9; ++i) {
- _buttons[i].signal_clicked().connect(
- sigc::bind(sigc::mem_fun(*this, &AnchorSelector::btn_activated), i));
+ for(int i = 0; i < 9; ++i) {
+ _buttons[i].signal_clicked().connect(
+ sigc::bind(sigc::mem_fun(*this, &AnchorSelector::btn_activated), i));
- _container.attach(_buttons[i], i % 3, i / 3, 1, 1);
- }
- _selection = 4;
- _buttons[4].set_active();
+ _container.attach(_buttons[i], i % 3, i / 3, 1, 1);
+ }
+ _selection = 4;
+ _buttons[4].set_active();
- this->add(_container);
+ this->add(_container);
}
AnchorSelector::~AnchorSelector()
@@ -62,27 +62,26 @@ AnchorSelector::~AnchorSelector()
void AnchorSelector::btn_activated(int index)
{
-
- if(_selection == index && _buttons[index].get_active() == false)
- {
- _buttons[index].set_active(true);
- }
- else if(_selection != index && _buttons[index].get_active())
- {
- int old_selection = _selection;
- _selection = index;
- _buttons[old_selection].set_active(false);
- _selectionChanged.emit();
- }
+ if(_selection == index && _buttons[index].get_active() == false)
+ {
+ _buttons[index].set_active(true);
+ }
+ else if(_selection != index && _buttons[index].get_active())
+ {
+ int old_selection = _selection;
+ _selection = index;
+ _buttons[old_selection].set_active(false);
+ _selectionChanged.emit();
+ }
}
void AnchorSelector::setAlignment(int horizontal, int vertical)
{
- int index = 3 * vertical + horizontal;
- if(index >= 0 && index < 9)
- {
- _buttons[index].set_active(!_buttons[index].get_active());
- }
+ int index = 3 * vertical + horizontal;
+ if(index >= 0 && index < 9)
+ {
+ _buttons[index].set_active(!_buttons[index].get_active());
+ }
}
} // namespace Widget
diff --git a/src/ui/widget/preferences-widget.h b/src/ui/widget/preferences-widget.h
index d8d0123d0..80cbf46b6 100644
--- a/src/ui/widget/preferences-widget.h
+++ b/src/ui/widget/preferences-widget.h
@@ -247,11 +247,11 @@ protected:
bool on_mnemonic_activate( bool group_cycling ) override;
};
-class PrefOpenFolder : public Gtk::HBox
-{
-public:
+class PrefOpenFolder : public Gtk::HBox {
+ public:
void init(Glib::ustring const &entry_string, Glib::ustring const &tooltip);
-protected:
+
+ protected:
Gtk::Button *relatedButton;
Gtk::Entry *relatedEntry;
void onRelatedButtonClickedCallback();