From 15c3f793c7601f371d8fd1c65c0fe763a0560bda Mon Sep 17 00:00:00 2001
From: patthoyts <patthoyts@users.sourceforge.net>
Date: Wed, 7 Oct 2009 19:42:41 +0000
Subject: [Bug 2787164] fix size of dropdown arrow on combobox and menubutton
 for Windows 7.

---
 ChangeLog                  |  5 +++++
 library/ttk/vistaTheme.tcl | 21 ++++++++++++++++++---
 2 files changed, 23 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 9e659af..1a2bc64 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2009-10-07  Pat Thoyts  <patthoyts@users.sourceforge.net>
+
+	* library/ttk/vistaTheme.tcl: [Bug 2787164] fix size of dropdown
+	arrow on combobox and menubutton for Windows 7.
+
 2009-10-07  Donal K. Fellows  <dkf@users.sf.net>
 
 	* unix/tkUnixScrlbr.c (TkpComputeScrollbarGeometry): [Patch 2088597]:
diff --git a/library/ttk/vistaTheme.tcl b/library/ttk/vistaTheme.tcl
index 76f3e3e..107f227 100644
--- a/library/ttk/vistaTheme.tcl
+++ b/library/ttk/vistaTheme.tcl
@@ -16,6 +16,14 @@ namespace eval ttk::theme::vista {
 
     ttk::style theme settings vista {
         
+        # We should ask the system for these, but for now...
+	set SM {
+	    SM_CXVSCROLL 17 SM_CYVSCROLL 0
+	    SM_CXHSCROLL 0 SM_CYHSCROLL 17
+	}
+	set cx [expr {[dict get $SM SM_CXVSCROLL] / 2}]
+	set cy [expr {[dict get $SM SM_CYVSCROLL] / 2}]
+
  	ttk::style configure . \
 	    -background SystemButtonFace \
 	    -foreground SystemWindowText \
@@ -33,6 +41,11 @@ namespace eval ttk::theme::vista {
 	ttk::style configure TCheckbutton -padding 2
 	ttk::style configure TMenubutton -padding {8 4}
 
+	ttk::style element create Menubutton.dropdown vsapi \
+	    TOOLBAR 4 {{selected active} 6 {selected !active} 5 
+		disabled 4 pressed 3 active 2 {} 1} \
+	    -padding [list $cx $cy]
+
 	ttk::style configure TNotebook -tabmargins {2 2 2 0}
 	ttk::style map TNotebook.Tab \
 	    -expand [list selected {2 2 2 2}]
@@ -56,7 +69,8 @@ namespace eval ttk::theme::vista {
         ttk::style element create Combobox.border vsapi \
             COMBOBOX 4 {disabled 4 focus 3 active 2 hover 2 {} 1}
         ttk::style element create Combobox.rightdownarrow vsapi \
-            COMBOBOX 6 {disabled 4 pressed 3 active 2 {} 1}
+            COMBOBOX 6 {disabled 4 pressed 3 active 2 {} 1} \
+            -padding [list $cx $cy]
         ttk::style layout TCombobox {
             Combobox.border -sticky nswe -border 0 -children {
                 Combobox.rightdownarrow -side right -sticky ns
@@ -200,7 +214,8 @@ namespace eval ttk::theme::vista {
         
         # Treeview
         ttk::style configure Item -padding {4 0 0 0}
-         
+        
+        unset -nocomplain cx cy
         package provide ttk::theme::vista 1.0
     }
-}
\ No newline at end of file
+}
-- 
cgit v0.12