diff options
| author | Jabier Arraiza <jabier.arraiza@marker.es> | 2019-02-17 20:35:00 +0000 |
|---|---|---|
| committer | Jabiertxof <jabier.arraiza@marker.es> | 2019-02-20 15:35:31 +0000 |
| commit | 84c4be73f485694e1e7935ac2cef6ed36f0165eb (patch) | |
| tree | 4cafcb8293695817b72c1bafa0a4df3f749ee838 | |
| parent | minor fixes (diff) | |
| download | inkscape-84c4be73f485694e1e7935ac2cef6ed36f0165eb.tar.gz inkscape-84c4be73f485694e1e7935ac2cef6ed36f0165eb.zip | |
Fix compiling issues
| -rw-r--r-- | src/ui/dialog/attrdialog.h | 4 | ||||
| -rw-r--r-- | src/ui/dialog/cssdialog.cpp | 61 | ||||
| -rw-r--r-- | src/ui/dialog/cssdialog.h | 13 | ||||
| -rw-r--r-- | src/ui/dialog/xml-tree.cpp | 12 | ||||
| -rw-r--r-- | src/ui/dialog/xml-tree.h | 7 |
5 files changed, 69 insertions, 28 deletions
diff --git a/src/ui/dialog/attrdialog.h b/src/ui/dialog/attrdialog.h index 93d9a1277..68ea14cc9 100644 --- a/src/ui/dialog/attrdialog.h +++ b/src/ui/dialog/attrdialog.h @@ -10,8 +10,8 @@ * Released under GNU GPLv2 or later, read the file 'COPYING' for more information */ -#ifndef ATTRDIALOG_H -#define ATTRDIALOG_H +#ifndef SEEN_UI_DIALOGS_ATTRDIALOG_H +#define SEEN_UI_DIALOGS_ATTRDIALOG_H #include "desktop.h" #include "message.h" diff --git a/src/ui/dialog/cssdialog.cpp b/src/ui/dialog/cssdialog.cpp index ae2843091..844481163 100644 --- a/src/ui/dialog/cssdialog.cpp +++ b/src/ui/dialog/cssdialog.cpp @@ -16,12 +16,13 @@ #include "message-context.h" #include "message-stack.h" -#include "selection.h" #include "style.h" +#include "selection.h" #include "style-internal.h" -#include "verbs.h" + #include "ui/icon-loader.h" #include "ui/widget/iconrenderer.h" +#include "verbs.h" #include "xml/node-event-vector.h" #include "xml/attribute-record.h" @@ -78,6 +79,11 @@ CssDialog::CssDialog(): addRenderer->add_icon("edit-delete"); addRenderer->signal_activated().connect(sigc::mem_fun(*this, &CssDialog::onPropertyDelete)); + _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()))); + int addCol = _treeView.append_column("", *addRenderer) - 1; Gtk::TreeViewColumn *col = _treeView.get_column(addCol); if (col) { @@ -118,23 +124,23 @@ CssDialog::CssDialog(): _attrCol->set_sort_column(_cssColumns._styleAttrVal); } - status.set_halign(Gtk::ALIGN_START); - status.set_valign(Gtk::ALIGN_CENTER); - status.set_size_request(1, -1); - status.set_markup(""); - status.set_line_wrap(true); - status_box.pack_start(status, TRUE, TRUE, 0); - _getContents()->pack_end(status_box, false, false, 2); + renderer = Gtk::manage(new Gtk::CellRendererText()); + renderer->property_editable() = true; + int sheetColNum = _treeView.append_column("Actual", *renderer) - 1; + _sheetCol = _treeView.get_column(sheetColNum); + if (_sheetCol) { + _sheetCol->add_attribute(renderer->property_text(), _cssColumns._styleSheetVal); + _sheetCol->add_attribute(renderer->property_foreground_rgba(), _cssColumns.label_color); + _sheetCol->set_sort_column(_cssColumns._styleSheetVal); + } + + // Set the inital sort column (and direction) to place real attributes at the top. + _store->set_sort_column (_cssColumns.deleteButton, Gtk::SORT_DESCENDING); - _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()))); _getContents()->pack_start(*_scrolledWindow, Gtk::PACK_EXPAND_WIDGET); css_reset_context(0); setDesktop(getDesktop()); - } /** @@ -144,11 +150,18 @@ CssDialog::CssDialog(): CssDialog::~CssDialog() { setDesktop(nullptr); + _repr = nullptr; _message_changed_connection.disconnect(); _message_context = nullptr; _message_stack = nullptr; _message_changed_connection.~connection(); - _repr = nullptr; +} + +void CssDialog::_set_status_message(Inkscape::MessageType /*type*/, const gchar *message, GtkWidget *widget) +{ + if (widget) { + gtk_label_set_markup(GTK_LABEL(widget), message ? message : ""); + } } @@ -163,7 +176,6 @@ void CssDialog::setDesktop(SPDesktop* desktop) } /** - * @brief CssDialog::setRepr * * Set the internal xml object that I'm working on right now. @@ -273,8 +285,25 @@ void CssDialog::onAttrChanged(Inkscape::XML::Node *repr, const gchar * name, con row[_cssColumns.deleteButton] = false; } } + } +} + /* + * Sets the CSSDialog status bar, depending on which attr is selected. + */ +void CssDialog::css_reset_context(gint css) +{ + if (css == 0) { + _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, + _("Property <b>%s</b> selected. Press <b>Ctrl+Enter</b> when done editing to commit changes."), name); + } +} +/** * @brief CssDialog::setStyleProperty * * Set or delete a single property in the style attribute. diff --git a/src/ui/dialog/cssdialog.h b/src/ui/dialog/cssdialog.h index 401093e5b..4c2498b38 100644 --- a/src/ui/dialog/cssdialog.h +++ b/src/ui/dialog/cssdialog.h @@ -12,19 +12,24 @@ * Released under GNU GPL v2+, read the file 'COPYING' for more information. */ -#ifndef CSSDIALOG_H -#define CSSDIALOG_H +#ifndef SEEN_UI_DIALOGS_CSSDIALOG_H +#define SEEN_UI_DIALOGS_CSSDIALOG_H + +#include "desktop.h" +#include "message.h" #include <glibmm/regex.h> #include <gtkmm/treeview.h> +<<<<<<< HEAD +======= +#include <gtkmm/dialog.h> +>>>>>>> Fix compiling issues #include <gtkmm/liststore.h> #include <gtkmm/scrolledwindow.h> #include <gtkmm/treeview.h> #include <ui/widget/panel.h> -#include "desktop.h" - #define CSS_DIALOG(obj) (dynamic_cast<Inkscape::UI::Dialog::CssDialog*>((Inkscape::UI::Dialog::CssDialog*)obj)) #define REMOVE_SPACES(x) x.erase(0, x.find_first_not_of(' ')); x.erase(x.find_last_not_of(' ') + 1); diff --git a/src/ui/dialog/xml-tree.cpp b/src/ui/dialog/xml-tree.cpp index 24aaa89d3..1cbf01107 100644 --- a/src/ui/dialog/xml-tree.cpp +++ b/src/ui/dialog/xml-tree.cpp @@ -41,8 +41,6 @@ #include "ui/tools/tool-base.h" #include "widgets/sp-xmlview-tree.h" -#include "ui/dialog/attrdialog.h" -#include "ui/dialog/cssdialog.h" namespace Inkscape { namespace UI { @@ -197,8 +195,12 @@ XmlTree::XmlTree() : lower_node_button.signal_clicked().connect(sigc::mem_fun(*this, &XmlTree::cmd_lower_node)); styles = new CssDialog; - css_box.pack_start(*styles); - flowbox_content->insert(&css_box, _("_Styles"), FLOWBOX_PAGE_STYLES, false, 200); + styles_box.pack_start(*styles); + flowbox_content->insert(&styles_box, _("_Styles"), FLOWBOX_PAGE_STYLES, false, 200); + + selectors = new StyleDialog; + selectors_box.pack_start(*selectors); + flowbox_content->insert(&selectors_box, _("S_electors"), FLOWBOX_PAGE_SELECTORS, false, 200); desktopChangeConn = deskTrack.connectDesktopChanged( sigc::mem_fun(*this, &XmlTree::set_tree_desktop) ); deskTrack.connect(GTK_WIDGET(gobj())); @@ -356,9 +358,11 @@ void XmlTree::propagate_tree_select(Inkscape::XML::Node *repr) { attributes->setRepr(repr); styles->setRepr(repr); + //selectors->setRepr(repr); } else { attributes->setRepr(nullptr); styles->setRepr(nullptr); + //selectors->setRepr(nullptr); } } diff --git a/src/ui/dialog/xml-tree.h b/src/ui/dialog/xml-tree.h index 01b709451..918a7c8fd 100644 --- a/src/ui/dialog/xml-tree.h +++ b/src/ui/dialog/xml-tree.h @@ -10,8 +10,8 @@ * Released under GNU GPL v2+, read the file 'COPYING' for more information. */ -#ifndef SEEN_DIALOGS_XML_TREE_H -#define SEEN_DIALOGS_XML_TREE_H +#ifndef SEEN_UI_DIALOGS_XML_TREE_H +#define SEEN_UI_DIALOGS_XML_TREE_H #include <memory> @@ -221,6 +221,9 @@ private: Gtk::Button *create_button; Gtk::VBox node_box; + Gtk::VBox attr_box; + Gtk::VBox selectors_box; + Gtk::VBox styles_box; Gtk::HBox status_box; Gtk::Label status; Gtk::Toolbar tree_toolbar; |
