Commit 0376b096 authored by Murray Cumming's avatar Murray Cumming
Browse files

Replace most uses of Gtk::Alignment in the code.

parent 8cd31c84
......@@ -38,7 +38,9 @@ Box_Data_Calendar_Related::Box_Data_Calendar_Related()
{
set_size_request(400, -1); //An arbitrary default.
m_Alignment.add(m_calendar);
m_Frame.add(m_calendar);
m_calendar.set_margin_start(UiUtils::DEFAULT_SPACING_LARGE);
m_calendar.set_margin_top(UiUtils::DEFAULT_SPACING_SMALL);
m_calendar.show();
//m_calendar.set_show_details();
......@@ -99,14 +101,17 @@ bool Box_Data_Calendar_Related::init_db_details(const Glib::ustring& parent_tabl
m_Label.set_markup(UiUtils::bold_message(title));
m_Label.show();
m_Alignment.set_padding(UiUtils::DEFAULT_SPACING_SMALL /* top */, 0, UiUtils::DEFAULT_SPACING_LARGE /* left */, 0);
m_calendar.set_margin_start(UiUtils::DEFAULT_SPACING_LARGE);
m_calendar.set_margin_top(UiUtils::DEFAULT_SPACING_SMALL);
}
else
{
m_Label.set_markup(Glib::ustring());
m_Label.hide();
m_Alignment.set_padding(0, 0, 0, 0); //The box itself has padding of 6.
//The box itself has padding of 6.
m_calendar.set_margin_start(0);
m_calendar.set_margin_top(0);
}
if(m_portal)
......
......@@ -35,11 +35,11 @@ namespace Glom
Box_Data_List_Related::Box_Data_List_Related()
{
m_Alignment.add(m_AddDel);
m_Frame.add(m_AddDel);
add_view(&m_AddDel); //Give it access to the document.
m_AddDel.show();
m_AddDel.set_height_rows(6, 6);
m_Alignment.show();
m_Frame.show();
//Connect signals:
m_AddDel.signal_user_requested_edit().connect(sigc::mem_fun(*this, &Box_Data_List_Related::on_adddel_user_requested_edit));
......@@ -102,7 +102,9 @@ bool Box_Data_List_Related::init_db_details(const Glib::ustring& parent_table, b
if(!(m_Frame.get_label_widget()))
m_Frame.set_label_widget(m_Label);
m_Alignment.set_padding(UiUtils::DEFAULT_SPACING_SMALL /* top */, 0, UiUtils::DEFAULT_SPACING_LARGE /* left */, 0);
m_AddDel.set_margin_start(UiUtils::DEFAULT_SPACING_LARGE);
m_AddDel.set_margin_top(UiUtils::DEFAULT_SPACING_SMALL);
}
else
{
......@@ -111,7 +113,9 @@ bool Box_Data_List_Related::init_db_details(const Glib::ustring& parent_table, b
if(m_Frame.get_label_widget())
m_Frame.unset_label(); //Otherwise the allocation is calculated wrong due to GtkFrame bug: https://bugzilla.gnome.org/show_bug.cgi?id=662915
m_Alignment.set_padding(0.0f, 0.0f, 0.0f, 0.0f); //The box itself has padding of 6.
//The box itself has padding of 6:
m_AddDel.set_margin_start(0);
m_AddDel.set_margin_top(0);
}
if(m_portal)
......
......@@ -37,17 +37,14 @@ Box_Data_Portal::Box_Data_Portal()
{
//m_Frame.set_label_widget(m_Label_Related);
m_Frame.set_shadow_type(Gtk::SHADOW_NONE);
m_Frame.add(m_Alignment);
m_Frame.show();
m_Frame.set_label_widget(m_Label);
m_Label.show();
//The AddDel or Calendar is added to this:
m_Alignment.set_padding(UiUtils::DEFAULT_SPACING_SMALL /* top */, 0, UiUtils::DEFAULT_SPACING_LARGE /* left */, 0);
m_Alignment.show();
//They must use child.set_margin_start(UiUtils::DEFAULT_SPACING_LARGE) and
//child.set_margin_top(UiUtils::DEFAULT_SPACING_SMALL);
add(m_Frame);
m_layout_name = "list_portal"; //Replaced by derived classes.
......
......@@ -25,7 +25,6 @@
#include "box_data_manyrecords.h"
#include <glom/utility_widgets/layoutwidgetbase.h>
#include <gtkmm/alignment.h>
#include <gtkmm/frame.h>
#include <gtkmm/label.h>
......@@ -121,7 +120,6 @@ protected:
Glib::ustring get_title_singular(const Glib::ustring& locale) const;
Gtk::Frame m_Frame;
Gtk::Alignment m_Alignment;
Gtk::Label m_Label;
sharedptr<LayoutItem_Portal> m_portal;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment