[glom] ListView: Make the rows high enough.
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glom] ListView: Make the rows high enough.
- Date: Tue, 5 Jul 2011 09:04:22 +0000 (UTC)
commit 93764196ad3ad864d67ef17723b1a647d8ab0348
Author: Murray Cumming <murrayc murrayc com>
Date: Tue Jul 5 11:04:14 2011 +0200
ListView: Make the rows high enough.
* glom/mode_data/db_adddel/db_adddel.cc: get_fixed_cell_height():
Add the GtkTreeView vertical-separator style property to the height,
which might be the right thing to do, and which works here at least.
ChangeLog | 8 ++++++++
glom/mode_data/db_adddel/db_adddel.cc | 15 +++++++++++----
2 files changed, 19 insertions(+), 4 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index f726ade..bfde916 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2011-07-05 Murray Cumming <murrayc murrayc com>
+
+ ListView: Make the rows high enough.
+
+ * glom/mode_data/db_adddel/db_adddel.cc: get_fixed_cell_height():
+ Add the GtkTreeView vertical-separator style property to the height,
+ which might be the right thing to do, and which works here at least.
+
2011-07-04 Murray Cumming <murrayc murrayc com>
Find: Make searching case-insensitive again.
diff --git a/glom/mode_data/db_adddel/db_adddel.cc b/glom/mode_data/db_adddel/db_adddel.cc
index 2a41df8..1709ffe 100644
--- a/glom/mode_data/db_adddel/db_adddel.cc
+++ b/glom/mode_data/db_adddel/db_adddel.cc
@@ -607,7 +607,7 @@ int DbAddDel::get_fixed_cell_height()
// when all columns are known.
//Get a default:
- Glib::RefPtr<Pango::Layout> refLayout = create_pango_layout("example");
+ Glib::RefPtr<Pango::Layout> refLayout = m_TreeView.create_pango_layout("ExampleEg");
int width = 0;
int height = 0;
refLayout->get_pixel_size(width, height);
@@ -629,7 +629,7 @@ int DbAddDel::get_fixed_cell_height()
continue;
// Translators: This is just some example text used to discover an appropriate height for user-entered text in the UI. This text itself is never shown to the user.
- Glib::RefPtr<Pango::Layout> refLayout = create_pango_layout(_("Example"));
+ Glib::RefPtr<Pango::Layout> refLayout = m_TreeView.create_pango_layout(_("ExampleEg"));
const Pango::FontDescription font(font_name);
refLayout->set_font_description(font);
int width = 0;
@@ -640,8 +640,15 @@ int DbAddDel::get_fixed_cell_height()
m_fixed_cell_height = height;
}
}
-
- return m_fixed_cell_height;
+
+ //We add extra spacing, because otherwise the bottom of letters such as "g" get cut off.
+ //We get this style property, which might be causing it. murrayc
+ //TODO: Find out if this is reallyt the right way to calculate the correct height:
+ int extra_height = 0;
+ gtk_widget_style_get(GTK_WIDGET(m_TreeView.gobj()), "vertical-separator", &extra_height, (void*)0);
+ std::cout << "debug: extra_height=" << extra_height << std::endl;
+
+ return m_fixed_cell_height + extra_height;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]