[glom] Print Layout Window: Make the top widgets more compact.
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glom] Print Layout Window: Make the top widgets more compact.
- Date: Sat, 6 Aug 2011 09:39:56 +0000 (UTC)
commit 832991fc0479dc55a3cf6de25d30c84d5c9033b1
Author: Murray Cumming <murrayc murrayc com>
Date: Fri Aug 5 19:11:52 2011 +0200
Print Layout Window: Make the top widgets more compact.
* ui/developer/window_print_layout_edit.glade:
* glom/mode_design/print_layouts/window_print_layout_edit.[h|cc]:
Make the table title/name a simple bold label with no Table: label,
as now in the main window. Make the other labels non-bold.
Make sure that we really show the table title with the name in brackets,
by removing an unused (but checked) widget pointer.
ChangeLog | 11 ++
glom/frame_glom.cc | 2 +-
.../print_layouts/window_print_layout_edit.cc | 43 ++++---
.../print_layouts/window_print_layout_edit.h | 2 +-
ui/developer/window_print_layout_edit.glade | 131 +++++++++-----------
5 files changed, 93 insertions(+), 96 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index ffddbed..1aea078 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,16 @@
2011-08-05 Murray Cumming <murrayc murrayc com>
+ Print Layout Window: Make the top widgets more compact.
+
+ * ui/developer/window_print_layout_edit.glade:
+ * glom/mode_design/print_layouts/window_print_layout_edit.[h|cc]:
+ Make the table title/name a simple bold label with no Table: label,
+ as now in the main window. Make the other labels non-bold.
+ Make sure that we really show the table title with the name in brackets,
+ by removing an unused (but checked) widget pointer.
+
+2011-08-05 Murray Cumming <murrayc murrayc com>
+
Print Layout: Correct drag position even when the layout is scrolled.
* glom/mode_design/print_layouts/window_print_layout_edit.[h|cc]:
diff --git a/glom/frame_glom.cc b/glom/frame_glom.cc
index ce70839..93b3406 100644
--- a/glom/frame_glom.cc
+++ b/glom/frame_glom.cc
@@ -1466,7 +1466,7 @@ void Frame_Glom::show_table_title()
// We hide this anyway: m_pLabel_Table->set_markup("<b>" + table_label + "</b>");
#else
//Show the table title in bold text, because it's important to the user.
- const Glib::ustring title = "<b>" + table_label + "</b>";
+ const Glib::ustring title = Utils::bold_message(table_label);
m_pLabel_Table_DataMode->set_markup(title);
m_pLabel_Table_FindMode->set_markup(title);
#endif
diff --git a/glom/mode_design/print_layouts/window_print_layout_edit.cc b/glom/mode_design/print_layouts/window_print_layout_edit.cc
index a379d64..366dec3 100644
--- a/glom/mode_design/print_layouts/window_print_layout_edit.cc
+++ b/glom/mode_design/print_layouts/window_print_layout_edit.cc
@@ -22,6 +22,7 @@
#include "window_print_layout_edit.h"
#include <glom/box_db_table.h>
#include <glom/print_layout/canvas_layout_item.h>
+#include <glom/utils_ui.h>
#include <libglom/data_structure/layout/layoutitem_line.h>
#include <libglom/data_structure/layout/layoutitem_portal.h>
#include <libglom/utils.h> //For bold_message()).
@@ -41,7 +42,6 @@ Window_PrintLayout_Edit::Window_PrintLayout_Edit(BaseObjectType* cobject, const
m_entry_name(0),
m_entry_title(0),
m_label_table_name(0),
- m_label_table(0),
m_button_close(0),
m_box(0),
m_drag_preview_requested(false),
@@ -57,7 +57,6 @@ Window_PrintLayout_Edit::Window_PrintLayout_Edit(BaseObjectType* cobject, const
builder->get_widget("vbox_canvas", m_box_canvas);
builder->get_widget("vbox_inner", m_box);
- //builder->get_widget("label_name", m_label_name);
builder->get_widget("label_table_name", m_label_table_name);
builder->get_widget("entry_name", m_entry_name);
builder->get_widget("entry_title", m_entry_title);
@@ -512,36 +511,40 @@ Window_PrintLayout_Edit::~Window_PrintLayout_Edit()
remove_view(&m_canvas);
}
-bool Window_PrintLayout_Edit::init_db_details(const Glib::ustring& table_name)
+void Window_PrintLayout_Edit::update_table_title()
{
+ std::cout << G_STRFUNC << ": debug 1" << std::endl;
+
Document* document = dynamic_cast<Document*>(get_document());
if(!document)
- return false;
+ {
+ std::cerr << G_STRFUNC << ": document was null" << std::endl;
+ return;
+ }
+
+ std::cout << G_STRFUNC << ": debug 2" << std::endl;
Glib::ustring table_label = _("None selected");
//Show the table title (if any) and name:
- Glib::ustring table_title = document->get_table_title(table_name);
+ Glib::ustring table_title = document->get_table_title(m_table_name);
if(table_title.empty())
- table_label = table_name;
+ table_label = m_table_name;
else
- table_label = table_title + " (" + table_name + ')';
-
- if(m_label_table)
- m_label_table->set_text(table_label);
-
- return true;
+ table_label = table_title + " (" + m_table_name + ')';
-/*
- if(m_box)
+ if(m_label_table_name)
{
- m_box->load_from_document();
+ m_label_table_name->set_markup(
+ Utils::bold_message(table_label));
+ }
+}
- Dialog_Design::init_db_details(table_name);
+bool Window_PrintLayout_Edit::init_db_details(const Glib::ustring& table_name)
+{
+ m_table_name = table_name;
+ update_table_title();
- m_box->init_db_details(table_name);
- }
-*/
return true;
}
@@ -563,7 +566,7 @@ void Window_PrintLayout_Edit::set_print_layout(const Glib::ustring& table_name,
//Dialog_Layout::set_document(layout, document, table_name, table_fields);
//Set the table name and title:
- m_label_table_name->set_text(table_name);
+ update_table_title();
m_entry_name->set_text(print_layout->get_name());
m_entry_title->set_text(print_layout->get_title());
diff --git a/glom/mode_design/print_layouts/window_print_layout_edit.h b/glom/mode_design/print_layouts/window_print_layout_edit.h
index 038fac5..3605b03 100644
--- a/glom/mode_design/print_layouts/window_print_layout_edit.h
+++ b/glom/mode_design/print_layouts/window_print_layout_edit.h
@@ -94,6 +94,7 @@ private:
Glib::RefPtr<Gdk::Pixbuf> get_icon_for_toolbar_item(Gtk::ToolItem& item);
+ void update_table_title();
void setup_context_menu();
void set_ruler_sizes();
@@ -112,7 +113,6 @@ private:
Gtk::Entry* m_entry_name;
Gtk::Entry* m_entry_title;
Gtk::Label* m_label_table_name;
- Gtk::Label* m_label_table;
//Gtk::Label* m_label_table_title;
Gtk::Button* m_button_close;
diff --git a/ui/developer/window_print_layout_edit.glade b/ui/developer/window_print_layout_edit.glade
index 43267c7..87af006 100644
--- a/ui/developer/window_print_layout_edit.glade
+++ b/ui/developer/window_print_layout_edit.glade
@@ -1,19 +1,17 @@
-<?xml version="1.0"?>
+<?xml version="1.0" encoding="UTF-8"?>
<interface>
<requires lib="gtk+" version="2.16"/>
- <!-- interface-requires gtksourceview 0.0 -->
- <!-- interface-naming-policy toplevel-contextual -->
-
<object class="GtkWindow" id="window_print_layout_edit">
+ <property name="can_focus">False</property>
<property name="title" translatable="yes">Print Layout Editor</property>
<child>
<object class="GtkVBox" id="vbox2">
<property name="visible">True</property>
- <property name="orientation">vertical</property>
+ <property name="can_focus">False</property>
<child>
<object class="GtkVBox" id="vbox_menu">
<property name="visible">True</property>
- <property name="orientation">vertical</property>
+ <property name="can_focus">False</property>
<child>
<placeholder/>
</child>
@@ -27,22 +25,25 @@
<child>
<object class="GtkHBox" id="hbox_inner">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="spacing">6</property>
<child>
<object class="GtkVBox" id="vbox_inner">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="border_width">6</property>
- <property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
<object class="GtkHBox" id="hbox20">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="spacing">6</property>
<child>
- <object class="GtkLabel" id="label207">
+ <object class="GtkLabel" id="label_table_name">
<property name="visible">True</property>
- <property name="label" translatable="yes"><b>Table:</b></property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes"><b>Table Name</b></property>
<property name="use_markup">True</property>
</object>
<packing>
@@ -52,9 +53,10 @@
</packing>
</child>
<child>
- <object class="GtkLabel" id="label_table_name">
+ <object class="GtkLabel" id="label208">
<property name="visible">True</property>
- <property name="label" translatable="yes">Table Name</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Layout name:</property>
</object>
<packing>
<property name="expand">False</property>
@@ -62,95 +64,60 @@
<property name="position">1</property>
</packing>
</child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkHBox" id="hbox17">
- <property name="visible">True</property>
- <property name="spacing">6</property>
<child>
- <object class="GtkHBox" id="hbox18">
+ <object class="GtkEntry" id="entry_name">
<property name="visible">True</property>
- <property name="spacing">6</property>
- <child>
- <object class="GtkLabel" id="label208">
- <property name="visible">True</property>
- <property name="label" translatable="yes"><b>Layout name:</b></property>
- <property name="use_markup">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkEntry" id="entry_name">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- </object>
- <packing>
- <property name="position">1</property>
- </packing>
- </child>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">â</property>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label209">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Title:</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
- <property name="position">0</property>
+ <property name="position">3</property>
</packing>
</child>
<child>
- <object class="GtkHBox" id="hbox19">
+ <object class="GtkEntry" id="entry_title">
<property name="visible">True</property>
- <child>
- <object class="GtkLabel" id="label209">
- <property name="visible">True</property>
- <property name="label" translatable="yes"><b>Title:</b></property>
- <property name="use_markup">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkEntry" id="entry_title">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- </object>
- <packing>
- <property name="position">1</property>
- </packing>
- </child>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">â</property>
</object>
<packing>
- <property name="position">1</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">4</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
- <property name="position">1</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkTable" id="table_canvas">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="n_rows">2</property>
<property name="n_columns">2</property>
<child>
<object class="GtkVBox" id="vbox_canvas">
<property name="visible">True</property>
- <property name="orientation">vertical</property>
+ <property name="can_focus">False</property>
<child>
<placeholder/>
</child>
@@ -165,14 +132,23 @@
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
</object>
<packing>
- <property name="position">2</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkHButtonBox" id="hbuttonbox43">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="layout_style">end</property>
<child>
<object class="GtkButton" id="button_close">
@@ -180,7 +156,8 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
- <property name="receives_default">False</property>
+ <property name="receives_default">True</property>
+ <property name="use_action_appearance">False</property>
<property name="use_stock">True</property>
</object>
<packing>
@@ -193,17 +170,20 @@
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
- <property name="position">3</property>
+ <property name="position">2</property>
</packing>
</child>
</object>
<packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkHandleBox" id="handle_box">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="handle_position">right</property>
<property name="snap_edge">right</property>
@@ -211,12 +191,15 @@
</object>
<packing>
<property name="expand">False</property>
+ <property name="fill">True</property>
<property name="pack_type">end</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]