{"thread":{"id":"40942","subject":"[PATCH 1/2] gitk: match ttk fonts to gitk fonts","startedAt":"2015-12-06T12:25:21Z","lastAt":"2015-12-19T02:26:40Z","messageCount":8,"participants":["Giuseppe Bilotta","Eric Sunshine","Paul Mackerras"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"274069","messageId":"1449404723-27177-1-git-send-email-giuseppe.bilotta@gmail.com","threadId":"40942","inReplyTo":null,"subject":"[PATCH 0/2] gitk spacing/sizing tuning for HiDPI","fromName":"Giuseppe Bilotta","fromEmail":"giuseppe.bilotta@gmail.com","sentAt":"2015-12-06T12:25:21Z","receivedAt":"2015-12-06T12:25:21Z","isPatch":true,"sender":{"key":"giuseppe.bilotta@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1464?v=4"},"body":"On my HiDPI monitor, most elements in gitk are correctly rendered, with two\nexceptions:\n\n* when using ttk, some elements do not use the same fonts as gitk would use\n  without, and since ttk picks _unscaled_ sizes this is very noticeable (and\nborderline illegible); the first patch fixes this;\n* the spacing between the checkboxes on top of the diff window are a little too\n  tightly-spaced; the second patch adds a little bit of breathing space.\n\nGiuseppe Bilotta (2):\n  gitk: match ttk fonts to gitk fonts\n  gitk: let .bleft.mid widgets 'breathe'\n\n gitk | 26 ++++++++++++++++++++++++--\n 1 file changed, 24 insertions(+), 2 deletions(-)\n\n-- \n2.6.3.659.gfdd8f28\n"},{"id":"274068","messageId":"1449404723-27177-2-git-send-email-giuseppe.bilotta@gmail.com","threadId":"40942","inReplyTo":"1449404723-27177-1-git-send-email-giuseppe.bilotta@gmail.com","subject":"[PATCH 1/2] gitk: match ttk fonts to gitk fonts","fromName":"Giuseppe Bilotta","fromEmail":"giuseppe.bilotta@gmail.com","sentAt":"2015-12-06T12:25:22Z","receivedAt":"2015-12-06T12:25:22Z","isPatch":true,"sender":{"key":"giuseppe.bilotta@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1464?v=4"},"body":"The fonts set in setoptions aren't consistently picked up by ttk, who\nuses its own predefined fonts. This is noticeable when switching\nbetween using and not using ttk with custom fonts or in HiDPI settings\n(where the default TTK fonts do _not_ respect tk sclaing).\n\nFix by mapping the ttk fontset to the one used by gitk internally.\n---\n gitk | 18 ++++++++++++++++++\n 1 file changed, 18 insertions(+)\n\ndiff --git a/gitk b/gitk\nindex fcc606e..e04264b 100755\n--- a/gitk\n+++ b/gitk\n@@ -1943,6 +1943,8 @@ proc confirm_popup {msg {owner .}} {\n }\n \n proc setoptions {} {\n+    global use_ttk\n+\n     if {[tk windowingsystem] ne \"win32\"} {\n         option add *Panedwindow.showHandle 1 startupFile\n         option add *Panedwindow.sashRelief raised startupFile\n@@ -1965,6 +1967,18 @@ proc setoptions {} {\n     option add *Listbox.font mainfont startupFile\n }\n \n+proc setttkstyle {} {\n+    eval font configure TkDefaultFont [fontflags mainfont]\n+    eval font configure TkTextFont [fontflags textfont]\n+    eval font configure TkHeadingFont [fontflags mainfont]\n+    eval font configure TkCaptionFont [fontflags mainfont] -weight bold\n+    eval font configure TkTooltipFont [fontflags uifont]\n+    eval font configure TkFixedFont   [fontflags textfont]\n+    eval font configure TkIconFont    [fontflags uifont]\n+    eval font configure TkMenuFont    [fontflags uifont]\n+    eval font configure TkSmallCaptionFont [fontflags uifont]\n+}\n+\n # Make a menu and submenus.\n # m is the window name for the menu, items is the list of menu items to add.\n # Each item is a list {mc label type description options...}\n@@ -12356,6 +12370,10 @@ if {![info exists have_ttk]} {\n set use_ttk [expr {$have_ttk && $want_ttk}]\n set NS [expr {$use_ttk ? \"ttk\" : \"\"}]\n \n+if {$use_ttk} {\n+    setttkstyle\n+}\n+\n regexp {^git version ([\\d.]*\\d)} [exec git version] _ git_version\n \n set show_notes {}\n-- \n2.6.3.659.gfdd8f28\n"},{"id":"274070","messageId":"1449404723-27177-3-git-send-email-giuseppe.bilotta@gmail.com","threadId":"40942","inReplyTo":"1449404723-27177-1-git-send-email-giuseppe.bilotta@gmail.com","subject":"[PATCH 2/2] gitk: let .bleft.mid widgets 'breathe'","fromName":"Giuseppe Bilotta","fromEmail":"giuseppe.bilotta@gmail.com","sentAt":"2015-12-06T12:25:23Z","receivedAt":"2015-12-06T12:25:23Z","isPatch":true,"sender":{"key":"giuseppe.bilotta@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1464?v=4"},"body":"The widgets on top of the diff window are very tightly packed. Make\nthem breathe a little by adding an 'i'-spaced padding between them.\n---\n gitk | 8 ++++++--\n 1 file changed, 6 insertions(+), 2 deletions(-)\n\ndiff --git a/gitk b/gitk\nindex e04264b..b621762 100755\n--- a/gitk\n+++ b/gitk\n@@ -2361,6 +2361,9 @@ proc makewindow {} {\n     ${NS}::frame .bleft.mid\n     ${NS}::frame .bleft.bottom\n \n+    # gap between sub-widgets\n+    set wgap [font measure uifont \"i\"]\n+\n     ${NS}::button .bleft.top.search -text [mc \"Search\"] -command dosearch\n     pack .bleft.top.search -side left -padx 5\n     set sstring .bleft.top.sstring\n@@ -2375,8 +2378,9 @@ proc makewindow {} {\n \t-command changediffdisp -variable diffelide -value {0 1}\n     ${NS}::radiobutton .bleft.mid.new -text [mc \"New version\"] \\\n \t-command changediffdisp -variable diffelide -value {1 0}\n+\n     ${NS}::label .bleft.mid.labeldiffcontext -text \"      [mc \"Lines of context\"]: \"\n-    pack .bleft.mid.diff .bleft.mid.old .bleft.mid.new -side left\n+    pack .bleft.mid.diff .bleft.mid.old .bleft.mid.new -side left -ipadx $wgap\n     spinbox .bleft.mid.diffcontext -width 5 \\\n \t-from 0 -increment 1 -to 10000000 \\\n \t-validate all -validatecommand \"diffcontextvalidate %P\" \\\n@@ -2384,7 +2388,7 @@ proc makewindow {} {\n     .bleft.mid.diffcontext set $diffcontext\n     trace add variable diffcontextstring write diffcontextchange\n     lappend entries .bleft.mid.diffcontext\n-    pack .bleft.mid.labeldiffcontext .bleft.mid.diffcontext -side left\n+    pack .bleft.mid.labeldiffcontext .bleft.mid.diffcontext -side left -ipadx $wgap\n     ${NS}::checkbutton .bleft.mid.ignspace -text [mc \"Ignore space change\"] \\\n \t-command changeignorespace -variable ignorespace\n     pack .bleft.mid.ignspace -side left -padx 5\n-- \n2.6.3.659.gfdd8f28\n"},{"id":"274094","messageId":"CAPig+cSwWxLMRh7e231svhtiJQH-5WuMO+3Y5x-e9tEOyHtqDg@mail.gmail.com","threadId":"40942","inReplyTo":"1449404723-27177-1-git-send-email-giuseppe.bilotta@gmail.com","subject":"Re: [PATCH 0/2] gitk spacing/sizing tuning for HiDPI","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2015-12-07T04:09:02Z","receivedAt":"2015-12-07T04:09:02Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Sun, Dec 6, 2015 at 7:25 AM, Giuseppe Bilotta\n<giuseppe.bilotta@gmail.com> wrote:\n> On my HiDPI monitor, most elements in gitk are correctly rendered, with two\n> exceptions:\n>\n> * when using ttk, some elements do not use the same fonts as gitk would use\n>   without, and since ttk picks _unscaled_ sizes this is very noticeable (and\n> borderline illegible); the first patch fixes this;\n> * the spacing between the checkboxes on top of the diff window are a little too\n>   tightly-spaced; the second patch adds a little bit of breathing space.\n\nBoth patches are missing your Signed-off-by:.\n"},{"id":"274164","messageId":"1449558351-15038-1-git-send-email-giuseppe.bilotta@gmail.com","threadId":"40942","inReplyTo":"CAPig+cSwWxLMRh7e231svhtiJQH-5WuMO+3Y5x-e9tEOyHtqDg@mail.gmail.com","subject":"[PATCH 1/2] gitk: match ttk fonts to gitk fonts","fromName":"Giuseppe Bilotta","fromEmail":"giuseppe.bilotta@gmail.com","sentAt":"2015-12-08T07:05:50Z","receivedAt":"2015-12-08T07:05:50Z","isPatch":true,"sender":{"key":"giuseppe.bilotta@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1464?v=4"},"body":"The fonts set in setoptions aren't consistently picked up by ttk, who\nuses its own predefined fonts. This is noticeable when switching\nbetween using and not using ttk with custom fonts or in HiDPI settings\n(where the default TTK fonts do _not_ respect tk sclaing).\n\nFix by mapping the ttk fontset to the one used by gitk internally.\n\nSigned-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>\n---\n gitk | 18 ++++++++++++++++++\n 1 file changed, 18 insertions(+)\n\ndiff --git a/gitk b/gitk\nindex fcc606e..e04264b 100755\n--- a/gitk\n+++ b/gitk\n@@ -1943,6 +1943,8 @@ proc confirm_popup {msg {owner .}} {\n }\n \n proc setoptions {} {\n+    global use_ttk\n+\n     if {[tk windowingsystem] ne \"win32\"} {\n         option add *Panedwindow.showHandle 1 startupFile\n         option add *Panedwindow.sashRelief raised startupFile\n@@ -1965,6 +1967,18 @@ proc setoptions {} {\n     option add *Listbox.font mainfont startupFile\n }\n \n+proc setttkstyle {} {\n+    eval font configure TkDefaultFont [fontflags mainfont]\n+    eval font configure TkTextFont [fontflags textfont]\n+    eval font configure TkHeadingFont [fontflags mainfont]\n+    eval font configure TkCaptionFont [fontflags mainfont] -weight bold\n+    eval font configure TkTooltipFont [fontflags uifont]\n+    eval font configure TkFixedFont   [fontflags textfont]\n+    eval font configure TkIconFont    [fontflags uifont]\n+    eval font configure TkMenuFont    [fontflags uifont]\n+    eval font configure TkSmallCaptionFont [fontflags uifont]\n+}\n+\n # Make a menu and submenus.\n # m is the window name for the menu, items is the list of menu items to add.\n # Each item is a list {mc label type description options...}\n@@ -12356,6 +12370,10 @@ if {![info exists have_ttk]} {\n set use_ttk [expr {$have_ttk && $want_ttk}]\n set NS [expr {$use_ttk ? \"ttk\" : \"\"}]\n \n+if {$use_ttk} {\n+    setttkstyle\n+}\n+\n regexp {^git version ([\\d.]*\\d)} [exec git version] _ git_version\n \n set show_notes {}\n-- \n2.6.3.659.gfdd8f28\n"},{"id":"274165","messageId":"1449558351-15038-2-git-send-email-giuseppe.bilotta@gmail.com","threadId":"40942","inReplyTo":"1449558351-15038-1-git-send-email-giuseppe.bilotta@gmail.com","subject":"[PATCH 2/2] gitk: let .bleft.mid widgets 'breathe'","fromName":"Giuseppe Bilotta","fromEmail":"giuseppe.bilotta@gmail.com","sentAt":"2015-12-08T07:05:51Z","receivedAt":"2015-12-08T07:05:51Z","isPatch":true,"sender":{"key":"giuseppe.bilotta@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1464?v=4"},"body":"The widgets on top of the diff window are very tightly packed. Make\nthem breathe a little by adding an 'i'-spaced padding between them.\n\nSigned-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>\n---\n gitk | 8 ++++++--\n 1 file changed, 6 insertions(+), 2 deletions(-)\n\ndiff --git a/gitk b/gitk\nindex e04264b..b621762 100755\n--- a/gitk\n+++ b/gitk\n@@ -2361,6 +2361,9 @@ proc makewindow {} {\n     ${NS}::frame .bleft.mid\n     ${NS}::frame .bleft.bottom\n \n+    # gap between sub-widgets\n+    set wgap [font measure uifont \"i\"]\n+\n     ${NS}::button .bleft.top.search -text [mc \"Search\"] -command dosearch\n     pack .bleft.top.search -side left -padx 5\n     set sstring .bleft.top.sstring\n@@ -2375,8 +2378,9 @@ proc makewindow {} {\n \t-command changediffdisp -variable diffelide -value {0 1}\n     ${NS}::radiobutton .bleft.mid.new -text [mc \"New version\"] \\\n \t-command changediffdisp -variable diffelide -value {1 0}\n+\n     ${NS}::label .bleft.mid.labeldiffcontext -text \"      [mc \"Lines of context\"]: \"\n-    pack .bleft.mid.diff .bleft.mid.old .bleft.mid.new -side left\n+    pack .bleft.mid.diff .bleft.mid.old .bleft.mid.new -side left -ipadx $wgap\n     spinbox .bleft.mid.diffcontext -width 5 \\\n \t-from 0 -increment 1 -to 10000000 \\\n \t-validate all -validatecommand \"diffcontextvalidate %P\" \\\n@@ -2384,7 +2388,7 @@ proc makewindow {} {\n     .bleft.mid.diffcontext set $diffcontext\n     trace add variable diffcontextstring write diffcontextchange\n     lappend entries .bleft.mid.diffcontext\n-    pack .bleft.mid.labeldiffcontext .bleft.mid.diffcontext -side left\n+    pack .bleft.mid.labeldiffcontext .bleft.mid.diffcontext -side left -ipadx $wgap\n     ${NS}::checkbutton .bleft.mid.ignspace -text [mc \"Ignore space change\"] \\\n \t-command changeignorespace -variable ignorespace\n     pack .bleft.mid.ignspace -side left -padx 5\n-- \n2.6.3.659.gfdd8f28\n"},{"id":"274166","messageId":"CAOxFTcyXcm0b-44j_TwR8giBeWkvugmTT=3bm4DQQvz_5kzP4A@mail.gmail.com","threadId":"40942","inReplyTo":"CAPig+cSwWxLMRh7e231svhtiJQH-5WuMO+3Y5x-e9tEOyHtqDg@mail.gmail.com","subject":"Re: [PATCH 0/2] gitk spacing/sizing tuning for HiDPI","fromName":"Giuseppe Bilotta","fromEmail":"giuseppe.bilotta@gmail.com","sentAt":"2015-12-08T07:08:29Z","receivedAt":"2015-12-08T07:08:29Z","isPatch":true,"sender":{"key":"giuseppe.bilotta@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1464?v=4"},"body":"On Mon, Dec 7, 2015 at 5:09 AM, Eric Sunshine <sunshine@sunshineco.com> wrote:\n>\n> Both patches are missing your Signed-off-by:.\n\nDoh sorry, resending now.\n\n\n-- \nGiuseppe \"Oblomov\" Bilotta\n"},{"id":"274744","messageId":"20151219022640.GC422@fergus.ozlabs.ibm.com","threadId":"40942","inReplyTo":"1449558351-15038-1-git-send-email-giuseppe.bilotta@gmail.com","subject":"Re: [PATCH 1/2] gitk: match ttk fonts to gitk fonts","fromName":"Paul Mackerras","fromEmail":"paulus@ozlabs.org","sentAt":"2015-12-19T02:26:40Z","receivedAt":"2015-12-19T02:26:40Z","isPatch":true,"sender":{"key":"paulus@ozlabs.org","avatar":"https://avatars.githubusercontent.com/u/1606439?v=4"},"body":"On Tue, Dec 08, 2015 at 08:05:50AM +0100, Giuseppe Bilotta wrote:\n> The fonts set in setoptions aren't consistently picked up by ttk, who\n> uses its own predefined fonts. This is noticeable when switching\n> between using and not using ttk with custom fonts or in HiDPI settings\n> (where the default TTK fonts do _not_ respect tk sclaing).\n> \n> Fix by mapping the ttk fontset to the one used by gitk internally.\n> \n> Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>\n\nThanks, applied both this and the following patch.\n\nPaul.\n"}]}