[glom/glom-1-28] Revert part of "Replace use of (deprecated) GtkLabel alignment."
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glom/glom-1-28] Revert part of "Replace use of (deprecated) GtkLabel alignment."
- Date: Sat, 7 Mar 2015 14:10:32 +0000 (UTC)
commit 69526622a3559e8c1eae40b1e6015c54883b0e7c
Author: Murray Cumming <murrayc murrayc com>
Date: Sat Mar 7 15:06:59 2015 +0100
Revert part of "Replace use of (deprecated) GtkLabel alignment."
This reverts part of d8730c4174ac3a27e8aac4ed13a6855445c4fbd6.
It has mistakenly replaced Entry::set_alignment() with
Widget::set_halign() instead of only replacing Misc::set_alignment().
Now the fields take up their full widths again, so the extra buttons
(New, Find, ..., etc) are not far away.
glom/mode_data/datawidget/entry.cc | 4 ++--
glom/utility_widgets/layoutwidgetbase.cc | 6 ++++--
2 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/glom/mode_data/datawidget/entry.cc b/glom/mode_data/datawidget/entry.cc
index de9c24e..0f2505f 100644
--- a/glom/mode_data/datawidget/entry.cc
+++ b/glom/mode_data/datawidget/entry.cc
@@ -77,8 +77,8 @@ void Entry::set_layout_item(const sharedptr<LayoutItem>& layout_item, const Glib
if(layout_field)
alignment = layout_field->get_formatting_used_horizontal_alignment(true /* for details view */);
- const Gtk::Align x_align = (alignment == Formatting::HORIZONTAL_ALIGNMENT_LEFT ? Gtk::ALIGN_START :
Gtk::ALIGN_END);
- set_halign(x_align);
+ const float x_align = (alignment == Formatting::HORIZONTAL_ALIGNMENT_LEFT ? 0.0 : 1.0);
+ set_alignment(x_align);
}
void Entry::set_glom_type(Field::glom_field_type glom_type)
diff --git a/glom/utility_widgets/layoutwidgetbase.cc b/glom/utility_widgets/layoutwidgetbase.cc
index 950ed1d..bb8a9a1 100644
--- a/glom/utility_widgets/layoutwidgetbase.cc
+++ b/glom/utility_widgets/layoutwidgetbase.cc
@@ -116,8 +116,10 @@ void LayoutWidgetBase::apply_formatting(Gtk::Widget& widget, const sharedptr<con
//Horizontal alignment:
const Formatting::HorizontalAlignment alignment =
layout_item->get_formatting_used_horizontal_alignment(true /* for details view */);
- const Gtk::Align x_align = (alignment == Formatting::HORIZONTAL_ALIGNMENT_LEFT ? Gtk::ALIGN_START :
Gtk::ALIGN_END);
- widget_to_change->set_halign(x_align);
+ const float x_align = (alignment == Formatting::HORIZONTAL_ALIGNMENT_LEFT ? 0.0 : 1.0);
+ Gtk::Misc* misc = dynamic_cast<Gtk::Misc*>(widget_to_change);
+ if(misc)
+ misc->set_alignment(x_align);
//Set justification on labels:
//Assume that people want left/right justification of multi-line text if they chose
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]