[glom] Details: Move the checkbutton titles to the left.
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glom] Details: Move the checkbutton titles to the left.
- Date: Fri, 18 Nov 2011 12:44:11 +0000 (UTC)
commit b1402f8983defa5488a76ab1550e4e741371e6ea
Author: Murray Cumming <murrayc murrayc com>
Date: Fri Nov 18 13:43:08 2011 +0100
Details: Move the checkbutton titles to the left.
* glom/mode_data/datawidget/checkbutton.h: Contructor:
Allow the title to be empty.
* glom/mode_data/datawidget/datawidget.cc: Give the checkbutton a title
at the left, like other widgets. This looks consistent.
ChangeLog | 9 +++++++++
glom/mode_data/datawidget/checkbutton.h | 2 +-
glom/mode_data/datawidget/datawidget.cc | 17 ++++++++++-------
3 files changed, 20 insertions(+), 8 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index fe36e35..2dd1d28 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2011-11-18 Murray Cumming <murrayc murrayc com>
+
+ Details: Move the checkbutton titles to the left.
+
+ * glom/mode_data/datawidget/checkbutton.h: Contructor:
+ Allow the title to be empty.
+ * glom/mode_data/datawidget/datawidget.cc: Give the checkbutton a title
+ at the left, like other widgets. This looks consistent.
+
2011-11-17 Murray Cumming <murrayc murrayc com>
Update an example screenshot.
diff --git a/glom/mode_data/datawidget/checkbutton.h b/glom/mode_data/datawidget/checkbutton.h
index b1cc0b9..a64b4d0 100644
--- a/glom/mode_data/datawidget/checkbutton.h
+++ b/glom/mode_data/datawidget/checkbutton.h
@@ -41,7 +41,7 @@ class CheckButton
public LayoutWidgetField
{
public:
- explicit CheckButton(const Glib::ustring& title);
+ explicit CheckButton(const Glib::ustring& title = Glib::ustring());
virtual ~CheckButton();
virtual void set_value(const Gnome::Gda::Value& value);
diff --git a/glom/mode_data/datawidget/datawidget.cc b/glom/mode_data/datawidget/datawidget.cc
index 61c56b7..39fbd7b 100644
--- a/glom/mode_data/datawidget/datawidget.cc
+++ b/glom/mode_data/datawidget/datawidget.cc
@@ -67,13 +67,16 @@ DataWidget::DataWidget(const sharedptr<LayoutItem_Field>& field, const Glib::ust
{
const Field::glom_field_type glom_type = field->get_glom_type();
set_layout_item(field, table_name);
+
+ //The GNOME HIG says that labels should have ":" at the end:
+ //http://library.gnome.org/devel/hig-book/stable/design-text-labels.html.en
+ const Glib::ustring title = Glib::ustring::compose(_("%1:"), field->get_title_or_name());
m_child = 0;
- LayoutWidgetField* pFieldWidget = 0;
- const Glib::ustring title = field->get_title_or_name();
+ LayoutWidgetField* pFieldWidget = 0;
if(glom_type == Field::TYPE_BOOLEAN)
{
- DataWidgetChildren::CheckButton* checkbutton = Gtk::manage( new DataWidgetChildren::CheckButton( title ) );
+ DataWidgetChildren::CheckButton* checkbutton = Gtk::manage( new DataWidgetChildren::CheckButton() );
checkbutton->show();
checkbutton->signal_toggled().connect( sigc::mem_fun(*this, &DataWidget::on_widget_edited) );
@@ -82,7 +85,9 @@ DataWidget::DataWidget(const sharedptr<LayoutItem_Field>& field, const Glib::ust
m_child = checkbutton;
pFieldWidget = checkbutton;
- m_label.set_text( Glib::ustring() ); //It is not used.
+ m_label.set_label(title);
+ m_label.set_alignment(0);
+ m_label.show();
}
else if(glom_type == Field::TYPE_IMAGE)
{
@@ -103,9 +108,7 @@ DataWidget::DataWidget(const sharedptr<LayoutItem_Field>& field, const Glib::ust
}
else
{
- //The GNOME HIG says that labels should have ":" at the end:
- //http://library.gnome.org/devel/hig-book/stable/design-text-labels.html.en
- m_label.set_label(title + ':');
+ m_label.set_label(title);
m_label.set_alignment(0);
m_label.show();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]