Re: Tree view item spacing in Repository Browser

Stefan Küng <[email protected]>
Newsgroups gmane.comp.version-control.subversion.tortoisesvn.devel
Message-ID <[email protected]>
On 13.05.2016 15:11, Ivan Zhakov wrote:
> I've noticed that currently there is no spacing between items in
> tree-view in Repository Browser (see tsvn-repo-browser-before.png).
>
> I suggest add 1-pixel padding for items. See
> tsvn-repo-browser-after.png and patch.


good idea!

But I'd like to use the theme data if possible.
See attached patch.

If you agree, please commit.

Stefan

-- 
        ___
   oo  // \\      "De Chelonian Mobile"
  (_,\/ \_/ \     TortoiseSVN
    \ \_/_\_/>    The coolest interface to (Sub)version control
    /_/   \_\     http://tortoisesvn.net

------------------------------------------------------
http://tortoisesvn.tigris.org/ds/viewMessage.do?dsForumId=757&dsMessageId=3172182

To unsubscribe from this discussion, e-mail: [[email protected]].
RepositoryBrowser.cpp.patch (text/plain, 971 B)
Index: src/TortoiseProc/RepositoryBrowser.cpp
===================================================================
--- src/TortoiseProc/RepositoryBrowser.cpp	(revision 27316)
+++ src/TortoiseProc/RepositoryBrowser.cpp	(working copy)
@@ -419,6 +419,19 @@
     SetWindowTheme(m_RepoList.GetSafeHwnd(), L"Explorer", NULL);
     SetWindowTheme(m_RepoTree.GetSafeHwnd(), L"Explorer", NULL);
 
+    int borderWidth = 0;
+    if (IsAppThemed())
+    {
+        HTHEME hTheme = OpenThemeData(m_RepoTree, L"TREEVIEW");
+        GetThemeMetric(hTheme, NULL, TVP_TREEITEM, TREIS_NORMAL, TMT_BORDERSIZE, &borderWidth);
+        CloseThemeData(hTheme);
+    }
+    else
+    {
+        borderWidth = GetSystemMetrics(SM_CXBORDER);
+    }
+    m_RepoTree.SetItemHeight(m_RepoTree.GetItemHeight() + 2 * borderWidth);
+
     AddAnchor(IDC_REPOS_BAR_CNR, TOP_LEFT, TOP_RIGHT);
     AddAnchor(IDC_REPOTREE, TOP_LEFT, BOTTOM_LEFT);
     AddAnchor(IDC_REPOLIST, TOP_LEFT, BOTTOM_RIGHT);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.