From e610752037735e10980a62a7ca7f0c3b2bd99d7d Mon Sep 17 00:00:00 2001 From: Patrick Storz Date: Sat, 10 Aug 2019 19:56:50 +0200 Subject: Add new widget "separator" which draws a line between widgets --- src/extension/prefdialog/widget-separator.cpp | 42 +++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 src/extension/prefdialog/widget-separator.cpp (limited to 'src/extension/prefdialog/widget-separator.cpp') diff --git a/src/extension/prefdialog/widget-separator.cpp b/src/extension/prefdialog/widget-separator.cpp new file mode 100644 index 000000000..94778e027 --- /dev/null +++ b/src/extension/prefdialog/widget-separator.cpp @@ -0,0 +1,42 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/** @file + * Separator widget for extensions + *//* + * Authors: + * Patrick Storz + * + * Copyright (C) 2019 Authors + * + * Released under GNU GPL v2+, read the file 'COPYING' for more information. + */ + +#include "widget-separator.h" + +#include + +#include "xml/node.h" +#include "extension/extension.h" + +namespace Inkscape { +namespace Extension { + + +WidgetSeparator::WidgetSeparator(Inkscape::XML::Node *xml, Inkscape::Extension::Extension *ext) + : InxWidget(xml, ext) +{ +} + +/** \brief Create a label for the description */ +Gtk::Widget *WidgetSeparator::get_widget(sigc::signal *changeSignal) +{ + if (_hidden) { + return nullptr; + } + + Gtk::Separator *separator = Gtk::manage(new Gtk::Separator()); + separator->show(); + return dynamic_cast(separator); +} + +} /* namespace Extension */ +} /* namespace Inkscape */ -- cgit v1.2.3