[gnote] Replace Boxes with Grids in insert timestamp prefs
- From: Aurimas Černius <aurimasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnote] Replace Boxes with Grids in insert timestamp prefs
- Date: Sun, 26 May 2013 12:20:33 +0000 (UTC)
commit ed44e2a56242c7eed68b6e3a146ef133b37b9655
Author: Aurimas Černius <aurisc4 gmail com>
Date: Sun May 26 15:18:57 2013 +0300
Replace Boxes with Grids in insert timestamp prefs
.../inserttimestamp/inserttimestamppreferences.cpp | 26 ++++++++++++-------
.../inserttimestamp/inserttimestamppreferences.hpp | 4 +-
2 files changed, 18 insertions(+), 12 deletions(-)
---
diff --git a/src/addins/inserttimestamp/inserttimestamppreferences.cpp
b/src/addins/inserttimestamp/inserttimestamppreferences.cpp
index 84e1e00..33864da 100644
--- a/src/addins/inserttimestamp/inserttimestamppreferences.cpp
+++ b/src/addins/inserttimestamp/inserttimestamppreferences.cpp
@@ -54,9 +54,12 @@ namespace inserttimestamp {
InsertTimestampPreferences::InsertTimestampPreferences(gnote::NoteManager &)
- : Gtk::VBox(false, 12)
{
_init_static();
+
+ set_row_spacing(12);
+ int row = 0;
+
// Get current values
Glib::RefPtr<Gio::Settings> settings = Preferences::obj().get_schema_settings(SCHEMA_INSERT_TIMESTAMP);
std::string dateFormat = settings->get_string(INSERT_TIMESTAMP_FORMAT);
@@ -68,12 +71,12 @@ namespace inserttimestamp {
"or use your own.")));
label->property_wrap() = true;
label->property_xalign() = 0;
- pack_start (*label);
+ attach(*label, 0, row++, 1, 1);
// Use Selected Format
Gtk::RadioButtonGroup group;
selected_radio = manage(new Gtk::RadioButton (group, _("Use _Selected Format"), true));
- pack_start (*selected_radio);
+ attach(*selected_radio, 0, row++, 1, 1);
// 1st column (visible): formatted date
// 2nd column (not visible): date format
@@ -89,7 +92,9 @@ namespace inserttimestamp {
scroll = manage(new Gtk::ScrolledWindow());
scroll->set_shadow_type(Gtk::SHADOW_IN);
- pack_start (*scroll);
+ scroll->set_hexpand(true);
+ scroll->set_vexpand(true);
+ attach(*scroll, 0, row++, 1, 1);
tv = manage(new Gtk::TreeView (store));
tv->set_headers_visible(false);
@@ -98,14 +103,15 @@ namespace inserttimestamp {
scroll->add (*tv);
// Use Custom Format
- Gtk::HBox *customBox = manage(new Gtk::HBox (false, 12));
- pack_start (*customBox);
+ Gtk::Grid *customBox = manage(new Gtk::Grid);
+ customBox->set_column_spacing(12);
+ attach(*customBox, 0, row++, 1, 1);
custom_radio = manage(new Gtk::RadioButton (group, _("_Use Custom Format"), true));
- customBox->pack_start (*custom_radio);
+ customBox->attach(*custom_radio, 0, 0, 1, 1);
custom_entry = manage(new Gtk::Entry());
- customBox->pack_start (*custom_entry);
+ customBox->attach(*custom_entry, 1, 0, 1, 1);
sharp::PropertyEditor * entryEditor = new sharp::PropertyEditor(
settings, INSERT_TIMESTAMP_FORMAT, *custom_entry);
@@ -117,8 +123,8 @@ namespace inserttimestamp {
for(iter = store->children().begin();
iter != store->children().end(); ++iter) {
- const Gtk::TreeRow & row(*iter);
- std::string value = row[m_columns.format];
+ const Gtk::TreeRow & tree_row(*iter);
+ std::string value = tree_row[m_columns.format];
if (dateFormat == value) {
// Found format in list
useCustom = false;
diff --git a/src/addins/inserttimestamp/inserttimestamppreferences.hpp
b/src/addins/inserttimestamp/inserttimestamppreferences.hpp
index 10d6fbb..f0324cb 100644
--- a/src/addins/inserttimestamp/inserttimestamppreferences.hpp
+++ b/src/addins/inserttimestamp/inserttimestamppreferences.hpp
@@ -23,8 +23,8 @@
#define __INSERTTIMESTAMP_PREFERENCES_HPP_
-#include <gtkmm/box.h>
#include <gtkmm/entry.h>
+#include <gtkmm/grid.h>
#include <gtkmm/liststore.h>
#include <gtkmm/radiobutton.h>
#include <gtkmm/scrolledwindow.h>
@@ -38,7 +38,7 @@ extern const char * SCHEMA_INSERT_TIMESTAMP;
extern const char * INSERT_TIMESTAMP_FORMAT;
class InsertTimestampPreferences
- : public Gtk::VBox
+ : public Gtk::Grid
{
public:
InsertTimestampPreferences(gnote::NoteManager &);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]