diff options
| author | Jabier Arraiza <jabier.arraiza@marker.es> | 2019-07-20 18:08:54 +0000 |
|---|---|---|
| committer | Jabier Arraiza <jabier.arraiza@marker.es> | 2019-08-02 21:26:28 +0000 |
| commit | d88020387250cbd9a087e7a6a28e2f4d7666890e (patch) | |
| tree | 654671694f5cfdaf8d3f5fa97e26b02592a32dfc /src/ui/toolbar | |
| parent | Add proposal 2 of line height (diff) | |
| download | inkscape-d88020387250cbd9a087e7a6a28e2f4d7666890e.tar.gz inkscape-d88020387250cbd9a087e7a6a28e2f4d7666890e.zip | |
Fix coding style
Diffstat (limited to 'src/ui/toolbar')
| -rw-r--r-- | src/ui/toolbar/text-toolbar.cpp | 35 | ||||
| -rw-r--r-- | src/ui/toolbar/text-toolbar.h | 38 |
2 files changed, 36 insertions, 37 deletions
diff --git a/src/ui/toolbar/text-toolbar.cpp b/src/ui/toolbar/text-toolbar.cpp index 73f77135f..e0c42900b 100644 --- a/src/ui/toolbar/text-toolbar.cpp +++ b/src/ui/toolbar/text-toolbar.cpp @@ -50,13 +50,13 @@ #include "style.h" #include "svg/css-ostringstream.h" -#include "util/units.h" #include "ui/icon-names.h" #include "ui/tools/text-tool.h" #include "ui/widget/combo-box-entry-tool-item.h" #include "ui/widget/combo-tool-item.h" #include "ui/widget/spin-button-tool-item.h" #include "ui/widget/unit-tracker.h" +#include "util/units.h" #include "widgets/style-utils.h" @@ -136,7 +136,8 @@ static void recursively_set_properties( SPObject* object, SPCSSAttr *css ) { sp_repr_css_attr_unref (css_unset); } -void sp_line_height_to_child(SPObject *root, SPCSSAttr *css, SPILengthOrNormal line_height, bool not_selected) { +void sp_line_height_to_child(SPObject *root, SPCSSAttr *css, SPILengthOrNormal line_height, bool not_selected) +{ if (root) { SPILengthOrNormal current_line_height = root->style->line_height; SPCSSAttr *css_item = sp_repr_css_attr_new(); @@ -156,13 +157,13 @@ void sp_line_height_to_child(SPObject *root, SPCSSAttr *css, SPILengthOrNormal l } // Apply line height changes (line-height value changed or line-height unit changed) -static void set_lineheight (SPCSSAttr *css, - std::vector<SPObject *> sub_selection_objs, - std::vector<SPObject *> sub_unselection_objs) { +static void set_lineheight(SPCSSAttr *css, std::vector<SPObject *> sub_selection_objs, + std::vector<SPObject *> sub_unselection_objs) +{ Inkscape::Preferences *prefs = Inkscape::Preferences::get(); -/* bool outer = prefs->getInt("/tools/text/outer_style", false); - gint mode = prefs->getInt("/tools/text/line_spacing_mode", 0); */ + /* bool outer = prefs->getInt("/tools/text/outer_style", false); + gint mode = prefs->getInt("/tools/text/line_spacing_mode", 0); */ SPDesktop *desktop = SP_ACTIVE_DESKTOP; // Calling sp_desktop_set_style will result in a call to TextTool::_styleSet() which @@ -172,16 +173,16 @@ static void set_lineheight (SPCSSAttr *css, if (sub_selection_objs.empty()) { out = true; } -/* if ( out ) { - // This will call sp_te_apply_style via signal - sp_desktop_set_style (desktop, css, true, true); - } else { */ + /* if ( out ) { + // This will call sp_te_apply_style via signal + sp_desktop_set_style (desktop, css, true, true); + } else { */ Inkscape::Selection *selection = desktop->getSelection(); - auto itemlist= selection->items(); - for (auto i: itemlist) { + auto itemlist = selection->items(); + for (auto i : itemlist) { if (dynamic_cast<SPText *>(i) || dynamic_cast<SPFlowtext *>(i)) { SPItem *item = i; - + // Scale by inverse of accumulated parent transform SPCSSAttr *css_reset = sp_repr_css_attr_new(); sp_repr_css_merge(css_reset, css); @@ -190,12 +191,12 @@ static void set_lineheight (SPCSSAttr *css, sp_repr_css_merge(css_set, css); Geom::Affine const local(item->i2doc_affine()); double const ex(local.descrim()); - if ( (ex != 0.0) && (ex != 1.0) ) { - sp_css_attr_scale(css_set, 1/ex); + if ((ex != 0.0) && (ex != 1.0)) { + sp_css_attr_scale(css_set, 1 / ex); } if (out) { item->changeCSS(css_set, "style"); - for (auto subitem :item->childList (false)) { + for (auto subitem : item->childList(false)) { sp_line_height_to_child(subitem, css_reset, SPILengthOrNormal("line_height", 0), false); } } else { diff --git a/src/ui/toolbar/text-toolbar.h b/src/ui/toolbar/text-toolbar.h index da9835f42..0d2ef1cc2 100644 --- a/src/ui/toolbar/text-toolbar.h +++ b/src/ui/toolbar/text-toolbar.h @@ -28,12 +28,12 @@ * Released under GNU GPL v2+, read the file 'COPYING' for more information. */ -#include "toolbar.h" #include "object/sp-object.h" -#include <gtkmm/popover.h> +#include "toolbar.h" +#include <gtkmm/adjustment.h> #include <gtkmm/box.h> +#include <gtkmm/popover.h> #include <gtkmm/separatortoolitem.h> -#include <gtkmm/adjustment.h> class SPDesktop; @@ -68,18 +68,18 @@ private: UI::Widget::ComboBoxEntryToolItem *_font_family_item; UI::Widget::ComboBoxEntryToolItem *_font_size_item; UI::Widget::ComboBoxEntryToolItem *_font_style_item; -/* Gtk::Popover *_line_spacing_menu; */ -/* Gtk::Box *_line_spacing_menu_content; */ -/* Gtk::ToolButton *_line_spacing_defaulting; */ -/* Gtk::ToggleToolButton *_line_height_unset_item; */ + /* Gtk::Popover *_line_spacing_menu; */ + /* Gtk::Box *_line_spacing_menu_content; */ + /* Gtk::ToolButton *_line_spacing_defaulting; */ + /* Gtk::ToggleToolButton *_line_height_unset_item; */ Gtk::ToggleToolButton *_line_spacing_menu_launcher; UI::Widget::ComboToolItem *_line_height_units_item; UI::Widget::SpinButtonToolItem *_line_height_item; -/* UI::Widget::ComboToolItem *_line_spacing_item; */ + /* UI::Widget::ComboToolItem *_line_spacing_item; */ Gtk::ToggleToolButton *_superscript_item; Gtk::ToggleToolButton *_subscript_item; -/* Gtk::ToggleToolButton *_outer_style_item; */ - + /* Gtk::ToggleToolButton *_outer_style_item; */ + UI::Widget::ComboToolItem *_align_item; UI::Widget::ComboToolItem *_writing_mode_item; @@ -110,31 +110,29 @@ private: void fontsize_value_changed(); void fontstyle_value_changed(); void script_changed(Gtk::ToggleToolButton *btn); -/* void lineheight_unset_changed(); */ -/* void outer_style_changed(); */ + /* void lineheight_unset_changed(); */ + /* void outer_style_changed(); */ void align_mode_changed(int mode); void writing_mode_changed(int mode); void orientation_changed(int mode); void direction_changed(int mode); void lineheight_value_changed(); void lineheight_unit_changed(int not_used); -/* void lineheight_defaulting(); */ -/* void line_height_popover_closed(); - void line_spacing_mode_changed(int mode); */ + /* void lineheight_defaulting(); */ + /* void line_height_popover_closed(); */ + /* void line_spacing_mode_changed(int mode); */ void wordspacing_value_changed(); void letterspacing_value_changed(); void dx_value_changed(); void dy_value_changed(); void rotation_value_changed(); - void selection_changed(Inkscape::Selection *selection, - bool subselection = false, - bool fullsubselection = false); + void selection_changed(Inkscape::Selection *selection, bool subselection = false, bool fullsubselection = false); void selection_modified(Inkscape::Selection *selection, guint flags); void subselection_changed(gpointer tc); void watch_ec(SPDesktop* desktop, Inkscape::UI::Tools::ToolBase* ec); void set_sizes(int unit); -/* void poptoggle(Gtk::ToggleToolButton *btn); */ -protected: + /* void poptoggle(Gtk::ToggleToolButton *btn); */ + protected: TextToolbar(SPDesktop *desktop); public: |
