summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJabier Arraiza <jabier.arraiza@marker.es>2018-12-24 18:08:45 +0000
committerJabiertxof <jabier.arraiza@marker.es>2018-12-26 11:46:59 +0000
commit43b6199dbd09a75e19a5808a99813bfeada2292f (patch)
tree8f70a4c590b056c45f5d1bddf69cb34e73b7ed04 /src
parentadd "add" button on same place (diff)
downloadinkscape-43b6199dbd09a75e19a5808a99813bfeada2292f.tar.gz
inkscape-43b6199dbd09a75e19a5808a99813bfeada2292f.zip
Fixing styles
Diffstat (limited to 'src')
-rw-r--r--src/ui/dialog/attrdialog.cpp17
-rw-r--r--src/ui/dialog/attrdialog.h12
-rw-r--r--src/ui/dialog/cssdialog.cpp25
-rw-r--r--src/ui/dialog/cssdialog.h10
-rw-r--r--src/ui/dialog/xml-tree.h10
-rw-r--r--src/ui/widget/ink-flow-box.cpp52
-rw-r--r--src/ui/widget/ink-flow-box.h14
7 files changed, 70 insertions, 70 deletions
diff --git a/src/ui/dialog/attrdialog.cpp b/src/ui/dialog/attrdialog.cpp
index 7861e13b5..21e92f600 100644
--- a/src/ui/dialog/attrdialog.cpp
+++ b/src/ui/dialog/attrdialog.cpp
@@ -103,13 +103,13 @@ AttrDialog::AttrDialog():
status.set_size_request(1, -1);
status.set_markup("");
status.set_line_wrap(true);
- status_box.pack_start( status, TRUE, TRUE, 0);
+ status_box.pack_start(status, TRUE, TRUE, 0);
_getContents()->pack_end(status_box, false, false, 2);
_message_stack = std::make_shared<Inkscape::MessageStack>();
_message_context = std::unique_ptr<Inkscape::MessageContext>(new Inkscape::MessageContext(_message_stack));
- _message_changed_connection = _message_stack->connectChanged(
- sigc::bind(sigc::ptr_fun(_set_status_message), GTK_WIDGET(status.gobj())));
+ _message_changed_connection =
+ _message_stack->connectChanged(sigc::bind(sigc::ptr_fun(_set_status_message), GTK_WIDGET(status.gobj())));
_valueRenderer = Gtk::manage(new Gtk::CellRendererText());
_valueRenderer->property_editable() = true;
@@ -198,13 +198,12 @@ void AttrDialog::_set_status_message(Inkscape::MessageType /*type*/, const gchar
void AttrDialog::attr_reset_context(gint attr)
{
if (attr == 0) {
- _message_context->set(Inkscape::NORMAL_MESSAGE,
- _("<b>Click</b> attribute to edit."));
- }
- else {
+ _message_context->set(Inkscape::NORMAL_MESSAGE, _("<b>Click</b> attribute to edit."));
+ } else {
const gchar *name = g_quark_to_string(attr);
- _message_context->setF(Inkscape::NORMAL_MESSAGE,
- _("Attribute <b>%s</b> selected. Press <b>Ctrl+Enter</b> when done editing to commit changes."), name);
+ _message_context->setF(
+ Inkscape::NORMAL_MESSAGE,
+ _("Attribute <b>%s</b> selected. Press <b>Ctrl+Enter</b> when done editing to commit changes."), name);
}
}
diff --git a/src/ui/dialog/attrdialog.h b/src/ui/dialog/attrdialog.h
index b263120ce..93d9a1277 100644
--- a/src/ui/dialog/attrdialog.h
+++ b/src/ui/dialog/attrdialog.h
@@ -13,13 +13,13 @@
#ifndef ATTRDIALOG_H
#define ATTRDIALOG_H
-#include <gtkmm/treeview.h>
+#include "desktop.h"
+#include "message.h"
+#include <gtkmm/dialog.h>
#include <gtkmm/liststore.h>
#include <gtkmm/scrolledwindow.h>
-#include <gtkmm/dialog.h>
+#include <gtkmm/treeview.h>
#include <ui/widget/panel.h>
-#include "message.h"
-#include "desktop.h"
#define ATTR_DIALOG(obj) (dynamic_cast<Inkscape::UI::Dialog::AttrDialog*>((Inkscape::UI::Dialog::AttrDialog*)obj))
@@ -85,8 +85,8 @@ public:
void setRepr(Inkscape::XML::Node * repr);
void setUndo(Glib::ustring const &event_description);
/**
- * Sets the XML status bar, depending on which attr is selected.
- */
+ * Sets the XML status bar, depending on which attr is selected.
+ */
void attr_reset_context(gint attr);
static void _set_status_message(Inkscape::MessageType type, const gchar *message, GtkWidget *dialog);
diff --git a/src/ui/dialog/cssdialog.cpp b/src/ui/dialog/cssdialog.cpp
index 903bed90d..9b68c207c 100644
--- a/src/ui/dialog/cssdialog.cpp
+++ b/src/ui/dialog/cssdialog.cpp
@@ -14,12 +14,12 @@
#include "cssdialog.h"
-#include "verbs.h"
-#include "selection.h"
#include "message-context.h"
#include "message-stack.h"
+#include "selection.h"
#include "ui/icon-loader.h"
#include "ui/widget/iconrenderer.h"
+#include "verbs.h"
#include "xml/attribute-record.h"
#include <glibmm/i18n.h>
@@ -50,7 +50,7 @@ CssDialog::CssDialog():
_store = Gtk::ListStore::create(_cssColumns);
_treeView.set_model(_store);
- Inkscape::UI::Widget::IconRenderer * addRenderer = manage(new Inkscape::UI::Widget::IconRenderer());
+ Inkscape::UI::Widget::IconRenderer *addRenderer = manage(new Inkscape::UI::Widget::IconRenderer());
addRenderer->add_icon("edit-delete");
_treeView.append_column("", *addRenderer);
@@ -96,13 +96,13 @@ CssDialog::CssDialog():
status.set_size_request(1, -1);
status.set_markup("");
status.set_line_wrap(true);
- status_box.pack_start( status, TRUE, TRUE, 0);
+ status_box.pack_start(status, TRUE, TRUE, 0);
_getContents()->pack_end(status_box, false, false, 2);
_message_stack = std::make_shared<Inkscape::MessageStack>();
_message_context = std::unique_ptr<Inkscape::MessageContext>(new Inkscape::MessageContext(_message_stack));
- _message_changed_connection = _message_stack->connectChanged(
- sigc::bind(sigc::ptr_fun(_set_status_message), GTK_WIDGET(status.gobj())));
+ _message_changed_connection =
+ _message_stack->connectChanged(sigc::bind(sigc::ptr_fun(_set_status_message), GTK_WIDGET(status.gobj())));
_getContents()->pack_start(_mainBox, Gtk::PACK_EXPAND_WIDGET);
@@ -148,13 +148,12 @@ void CssDialog::setDesktop(SPDesktop* desktop)
void CssDialog::css_reset_context(gint css)
{
if (css == 0) {
- _message_context->set(Inkscape::NORMAL_MESSAGE,
- _("<b>Click</b> CSS property to edit."));
- }
- else {
+ _message_context->set(Inkscape::NORMAL_MESSAGE, _("<b>Click</b> CSS property to edit."));
+ } else {
const gchar *name = g_quark_to_string(css);
- _message_context->setF(Inkscape::NORMAL_MESSAGE,
- _("Propery <b>%s</b> selected. Press <b>Ctrl+Enter</b> when done editing to commit changes."), name);
+ _message_context->setF(
+ Inkscape::NORMAL_MESSAGE,
+ _("Propery <b>%s</b> selected. Press <b>Ctrl+Enter</b> when done editing to commit changes."), name);
}
}
@@ -166,7 +165,7 @@ void CssDialog::css_reset_context(gint css)
*/
bool CssDialog::_addProperty(GdkEventButton *event)
{
- if(event->type == GDK_BUTTON_RELEASE && event->button == 1) {
+ if (event->type == GDK_BUTTON_RELEASE && event->button == 1) {
_propRow = *(_store->append());
return true;
}
diff --git a/src/ui/dialog/cssdialog.h b/src/ui/dialog/cssdialog.h
index b35ce3e90..36fcc831a 100644
--- a/src/ui/dialog/cssdialog.h
+++ b/src/ui/dialog/cssdialog.h
@@ -15,12 +15,12 @@
#ifndef CSSDIALOG_H
#define CSSDIALOG_H
-#include <gtkmm/treeview.h>
+#include "message.h"
+#include <gtkmm/dialog.h>
#include <gtkmm/liststore.h>
#include <gtkmm/scrolledwindow.h>
-#include <gtkmm/dialog.h>
+#include <gtkmm/treeview.h>
#include <ui/widget/panel.h>
-#include "message.h"
#include "desktop.h"
@@ -81,8 +81,8 @@ public:
Gtk::Label status;
/**
- * Sets the XML status bar, depending on which attr is selected.
- */
+ * Sets the XML status bar, depending on which attr is selected.
+ */
void css_reset_context(gint css);
static void _set_status_message(Inkscape::MessageType type, const gchar *message, GtkWidget *dialog);
diff --git a/src/ui/dialog/xml-tree.h b/src/ui/dialog/xml-tree.h
index b39c4d1be..52e9442ba 100644
--- a/src/ui/dialog/xml-tree.h
+++ b/src/ui/dialog/xml-tree.h
@@ -15,15 +15,15 @@
#include <memory>
-#include "ui/widget/panel.h"
#include "ui/widget/ink-flow-box.h"
+#include "ui/widget/panel.h"
+#include <gtkmm/button.h>
#include <gtkmm/entry.h>
+#include <gtkmm/paned.h>
+#include <gtkmm/scrolledwindow.h>
+#include <gtkmm/separatortoolitem.h>
#include <gtkmm/textview.h>
#include <gtkmm/toolbar.h>
-#include <gtkmm/separatortoolitem.h>
-#include <gtkmm/scrolledwindow.h>
-#include <gtkmm/paned.h>
-#include <gtkmm/button.h>
#include "ui/dialog/attrdialog.h"
#include "ui/dialog/cssdialog.h"
diff --git a/src/ui/widget/ink-flow-box.cpp b/src/ui/widget/ink-flow-box.cpp
index 99977dc19..394cf232c 100644
--- a/src/ui/widget/ink-flow-box.cpp
+++ b/src/ui/widget/ink-flow-box.cpp
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-or-later
/*
- * Inkflow-box widget.
+ * Inkflow-box widget.
* This widget allow pack widgets in a flowbox with a controller to show-hide
*
* Author:
@@ -12,19 +12,19 @@
*/
#ifdef HAVE_CONFIG_H
-# include "config.h" // only include where actually required!
+#include "config.h" // only include where actually required!
#endif
#include "preferences.h"
-#include "ui/widget/ink-flow-box.h"
#include "ui/icon-loader.h"
+#include "ui/widget/ink-flow-box.h"
#include <gtkmm/adjustment.h>
namespace Inkscape {
namespace UI {
namespace Widget {
-InkFlowBox::InkFlowBox(const gchar * name)
+InkFlowBox::InkFlowBox(const gchar *name)
{
set_name(name);
this->pack_start(_controller, false, false, 0);
@@ -35,11 +35,12 @@ InkFlowBox::InkFlowBox(const gchar * name)
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
tbutton->set_active(prefs->getBool(Glib::ustring("/dialogs/") + get_name() + Glib::ustring("/flowbox/lock"), true));
Glib::ustring iconname = "object-unlocked";
- if(tbutton->get_active()) {
+ if (tbutton->get_active()) {
iconname = "object-locked";
}
tbutton->set_image(*sp_get_icon_image(iconname, Gtk::ICON_SIZE_MENU));
- tbutton->signal_toggled().connect(sigc::bind< Gtk::ToggleButton* >(sigc::mem_fun (*this, &InkFlowBox::on_global_toggle), tbutton) );
+ tbutton->signal_toggled().connect(
+ sigc::bind<Gtk::ToggleButton *>(sigc::mem_fun(*this, &InkFlowBox::on_global_toggle), tbutton));
_controller.pack_start(*tbutton);
tbutton->show();
showing = 0;
@@ -48,29 +49,29 @@ InkFlowBox::InkFlowBox(const gchar * name)
InkFlowBox::~InkFlowBox() {}
-Glib::ustring
-InkFlowBox::getPrefsPath(gint pos) {
+Glib::ustring InkFlowBox::getPrefsPath(gint pos)
+{
return Glib::ustring("/dialogs/") + get_name() + Glib::ustring("/flowbox/index_") + std::to_string(pos);
}
-bool
-InkFlowBox::on_filter(Gtk::FlowBoxChild* child) {
+bool InkFlowBox::on_filter(Gtk::FlowBoxChild *child)
+{
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
- if(prefs->getBool(getPrefsPath(child->get_index()), true)) {
- showing ++;
+ if (prefs->getBool(getPrefsPath(child->get_index()), true)) {
+ showing++;
return true;
}
return false;
}
-void
-InkFlowBox::on_toggle(gint pos, Gtk::ToggleButton *tbutton) {
+void InkFlowBox::on_toggle(gint pos, Gtk::ToggleButton *tbutton)
+{
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
bool global = prefs->getBool(Glib::ustring("/dialogs/") + get_name() + Glib::ustring("/flowbox/lock"), true);
if (global && sensitive) {
sensitive = false;
bool active = true;
- for (auto child:tbutton->get_parent()->get_children()) {
+ for (auto child : tbutton->get_parent()->get_children()) {
if (tbutton != child) {
dynamic_cast<Gtk::ToggleButton *>(child)->set_active(active);
active = false;
@@ -83,19 +84,19 @@ InkFlowBox::on_toggle(gint pos, Gtk::ToggleButton *tbutton) {
prefs->setBool(getPrefsPath(pos), tbutton->get_active());
}
showing = 0;
- _flowbox.set_filter_func(sigc::mem_fun (*this, &InkFlowBox::on_filter));
+ _flowbox.set_filter_func(sigc::mem_fun(*this, &InkFlowBox::on_filter));
_flowbox.set_max_children_per_line(showing);
}
-void
-InkFlowBox::on_global_toggle(Gtk::ToggleButton *tbutton) {
+void InkFlowBox::on_global_toggle(Gtk::ToggleButton *tbutton)
+{
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
prefs->setBool(Glib::ustring("/dialogs/") + get_name() + Glib::ustring("/flowbox/lock"), tbutton->get_active());
sensitive = true;
if (tbutton->get_active()) {
sensitive = false;
bool active = true;
- for (auto child:tbutton->get_parent()->get_children()) {
+ for (auto child : tbutton->get_parent()->get_children()) {
if (tbutton != child) {
dynamic_cast<Gtk::ToggleButton *>(child)->set_active(active);
active = false;
@@ -103,26 +104,27 @@ InkFlowBox::on_global_toggle(Gtk::ToggleButton *tbutton) {
}
}
Glib::ustring iconname = "object-unlocked";
- if(tbutton->get_active()) {
+ if (tbutton->get_active()) {
iconname = "object-locked";
}
tbutton->set_image(*sp_get_icon_image(iconname, Gtk::ICON_SIZE_MENU));
sensitive = true;
}
-void
-InkFlowBox::insert(Gtk::Widget *widget, Glib::ustring label, gint pos, bool active, int minwidth){
+void InkFlowBox::insert(Gtk::Widget *widget, Glib::ustring label, gint pos, bool active, int minwidth)
+{
Gtk::ToggleButton *tbutton = new Gtk::ToggleButton(label, true);
tbutton->set_active(active);
- tbutton->signal_toggled().connect(sigc::bind<gint, Gtk::ToggleButton* >(sigc::mem_fun (*this, &InkFlowBox::on_toggle),pos, tbutton) );
+ tbutton->signal_toggled().connect(
+ sigc::bind<gint, Gtk::ToggleButton *>(sigc::mem_fun(*this, &InkFlowBox::on_toggle), pos, tbutton));
_controller.pack_start(*tbutton);
tbutton->show();
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
prefs->setBool(getPrefsPath(pos), active);
- widget->set_size_request(minwidth,-1);
+ widget->set_size_request(minwidth, -1);
_flowbox.insert(*widget, pos);
showing = 0;
- _flowbox.set_filter_func(sigc::mem_fun (*this, &InkFlowBox::on_filter) );
+ _flowbox.set_filter_func(sigc::mem_fun(*this, &InkFlowBox::on_filter));
_flowbox.set_max_children_per_line(showing);
}
diff --git a/src/ui/widget/ink-flow-box.h b/src/ui/widget/ink-flow-box.h
index 46c763937..be84ee988 100644
--- a/src/ui/widget/ink-flow-box.h
+++ b/src/ui/widget/ink-flow-box.h
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-or-later
/*
- * Inkflow-box widget.
+ * Inkflow-box widget.
* This widget allow pack widgets in a flowbox with a controller to show-hide
*
* Author:
@@ -14,11 +14,11 @@
#ifndef INKSCAPE_INK_FLOW_BOX_H
#define INKSCAPE_INK_FLOW_BOX_H
-#include <gtkmm/box.h>
#include <gtkmm/actionbar.h>
+#include <gtkmm/box.h>
#include <gtkmm/flowbox.h>
-#include <gtkmm/togglebutton.h>
#include <gtkmm/flowboxchild.h>
+#include <gtkmm/togglebutton.h>
#include <sigc++/signal.h>
namespace Inkscape {
@@ -30,20 +30,20 @@ namespace Widget {
*/
class InkFlowBox : public Gtk::VBox {
-public:
- InkFlowBox(const gchar * name);
+ public:
+ InkFlowBox(const gchar *name);
~InkFlowBox() override;
void insert(Gtk::Widget *widget, Glib::ustring label, gint pos, bool active, int minwidth);
void on_toggle(gint pos, Gtk::ToggleButton *tbutton);
void on_global_toggle(Gtk::ToggleButton *tbutton);
void set_visible(gint pos, bool visible);
- bool on_filter(Gtk::FlowBoxChild* child);
+ bool on_filter(Gtk::FlowBoxChild *child);
Glib::ustring getPrefsPath(gint pos);
/**
* Construct a InkFlowBox.
*/
-private:
+ private:
Gtk::FlowBox _flowbox;
Gtk::ActionBar _controller;
gint showing;