lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lmi] Dataview vs. listview appearance [PATCH]


From: Vaclav Slavik
Subject: Re: [lmi] Dataview vs. listview appearance [PATCH]
Date: Sat, 30 Jul 2011 15:04:21 +0200
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.15) Gecko/20110303 Thunderbird/3.1.9

Hi,

On 2011-07-16 21:10, Václav Slavík wrote:
>> > (1) Vertical spacing has widened. (It may be easier to read, but fewer
>> > rows fit on the screen.)
>
> There's wxDataViewCtrl::SetRowHeight(), so it may be tweakable without 
> changes to wx,
> although I suspect not: I think the current size is the minimal one already, 
> so
> we'll have to change wxDVC to allow smaller sizes. 

Fortunately, that wasn't the case, wxDataViewCtrl hardcodes the height of 
wxListCtrl
with 16px icons, so the fix is simple:


--
Use same row height as used by wxListCtrl.

By default, wxDataViewCtrl uses slightly larger spacing between row,
but LMI prefers to fit more content on the screen, even at the cost of
slightly worse readability.

GetCharHeight() + 1 matches exactly what wxListCtrl uses.
---
 census_view.cpp |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/census_view.cpp b/census_view.cpp
index 4ecb893..ba193e4 100644
--- a/census_view.cpp
+++ b/census_view.cpp
@@ -939,6 +939,12 @@ wxWindow* CensusView::CreateChildWindow()
         ,wxDefaultSize
         ,wxDV_ROW_LINES | wxDV_MULTIPLE
         );
+
+    // Use same row height as used by wxListCtrl without icons. By default,
+    // wxDataViewCtrl uses slightly larger spacing, but we prefer to fit more
+    // on the screen over slightly improved readability.
+    list_window_->SetRowHeight(list_window_->GetCharHeight() + 1);
+
     list_window_->AssociateModel(list_model_.get());
 
     // Show headers.
-- 
1.7.5.4


(I think it's better to keep wxDataViewCtrl's current default in wx, as the 
extra
whitespace does improve readability and it matches Explorer's look.)

Regards,
Vaclav



reply via email to

[Prev in Thread] Current Thread [Next in Thread]