diff --git a/lcl/interfaces/carbon/carbonthemes.pas b/lcl/interfaces/carbon/carbonthemes.pas index 025b2a87c2..3a18e01f5c 100644 --- a/lcl/interfaces/carbon/carbonthemes.pas +++ b/lcl/interfaces/carbon/carbonthemes.pas @@ -285,7 +285,7 @@ var ButtonDrawInfo: HIThemeButtonDrawInfo; LabelRect: HIRect; begin - if Details.Part = TVP_GLYPH then + if Details.Part in [TVP_GLYPH, TVP_HOTGLYPH] then begin ButtonDrawInfo.version := 0; ButtonDrawInfo.State := GetDrawState(Details); @@ -430,7 +430,7 @@ const begin case Details.Element of teTreeView: - if (Details.Part = TVP_GLYPH) then + if (Details.Part in [TVP_GLYPH, TVP_HOTGLYPH]) then begin Result := Types.Size( GetCarbonThemeMetric(kThemeMetricDisclosureTriangleWidth), diff --git a/lcl/interfaces/gtk2/gtk2themes.pas b/lcl/interfaces/gtk2/gtk2themes.pas index 53f429210c..bf50824ed0 100644 --- a/lcl/interfaces/gtk2/gtk2themes.pas +++ b/lcl/interfaces/gtk2/gtk2themes.pas @@ -100,11 +100,14 @@ begin end; teTreeview: begin - if Details.Part = TVP_GLYPH then + if Details.Part in [TVP_GLYPH, TVP_HOTGLYPH] then begin Result.Painter := gptExpander; Result.Shadow := GTK_SHADOW_NONE; - Result.State := GTK_STATE_NORMAL; + if Details.Part = TVP_GLYPH then + Result.State := GTK_STATE_NORMAL + else + Result.State := GTK_STATE_PRELIGHT; Result.Widget := GetStyleWidget(lgsTreeView); Result.Detail := 'treeview'; if Details.State = GLPS_CLOSED then @@ -122,7 +125,7 @@ function TGtk2ThemeServices.GetDetailSize(Details: TThemedElementDetails): TSize var AValue: TGValue; begin - if (Details.Element = teTreeView) and (Details.Part = TVP_GLYPH) then + if (Details.Element = teTreeView) and (Details.Part in [TVP_GLYPH, TVP_HOTGLYPH]) then begin FillChar(AValue, SizeOf(AValue), 0); g_value_init(@AValue, G_TYPE_INT); diff --git a/lcl/interfaces/qt/qtthemes.pas b/lcl/interfaces/qt/qtthemes.pas index 883e5e961f..dcbb52b2ab 100644 --- a/lcl/interfaces/qt/qtthemes.pas +++ b/lcl/interfaces/qt/qtthemes.pas @@ -245,6 +245,7 @@ begin begin opt := QStyleOption_create(Integer(QStyleOptionVersion), Integer(QStyleOptionSO_Default)); + QStyleOption_setState(opt, GetControlState(Details)); if AViewPortPaint then begin {we must reinitialize QPainter brush from opt since @@ -618,7 +619,7 @@ begin end; teTreeView: begin - if Details.Part = TVP_GLYPH then + if Details.Part in [TVP_GLYPH, TVP_HOTGLYPH] then begin Result.DrawVariant := qdvPrimitive; Result.PrimitiveElement := QStylePE_IndicatorBranch; diff --git a/lcl/interfaces/win32/win32themes.pas b/lcl/interfaces/win32/win32themes.pas index 03f5201805..a465d59ef8 100644 --- a/lcl/interfaces/win32/win32themes.pas +++ b/lcl/interfaces/win32/win32themes.pas @@ -66,7 +66,6 @@ uses TmSchema; const - ThemeDataNames: array[TThemedElement] of PWideChar = ( 'button', // teButton 'clock', // teClock @@ -94,6 +93,33 @@ const 'window' // teWindow ); + ThemeDataNamesVista: array[TThemedElement] of PWideChar = ( + 'button', // teButton + 'clock', // teClock + 'combobox', // teComboBox + 'edit', // teEdit + 'explorerbar', // teExplorerBar + 'header', // teHeader + 'explorer::listview', // teListView + 'menu', // teMenu + 'page', // tePage + 'progress', // teProgress + 'rebar', // teRebar + 'scrollbar', // teScrollBar + 'spin', // teSpin + 'startpanel', // teStartPanel + 'status', // teStatus + 'tab', // teTab + 'taskband', // teTaskBand + 'taskbar', // teTaskBar + 'toolbar', // teToolBar + 'tooltip', // teToolTip + 'trackbar', // teTrackBar + 'traynotify', // teTrayNotify + 'explorer::treeview', // teTreeview + 'window' // teWindow + ); + // standard windows icons (WinUser.h) // they are already defined in the rtl, however the // const = const defines after this fail with an illegal expression @@ -135,6 +161,8 @@ begin end; function TWin32ThemeServices.GetDetailSize(Details: TThemedElementDetails): TSize; +var + R: TRect; begin // GetThemeInt(Theme[Details.Element], Details.Part, Details.State, TMT_HEIGHT, Result); // does not work for some reason @@ -142,6 +170,12 @@ begin begin if (Details.Element = teToolBar) and (Details.Part = TP_SPLITBUTTONDROPDOWN) then Result.cx := 12 + else + if (Details.Element = teTreeview) and (Details.Part in [TVP_GLYPH, TVP_HOTGLYPH]) then + begin + R := Rect(0, 0, 800, 800); + GetThemePartSize(GetTheme(Details.Element), 0, Details.Part, Details.State, @R, TS_TRUE, Result); + end else Result := inherited GetDetailSize(Details); end @@ -254,7 +288,12 @@ end; function TWin32ThemeServices.GetTheme(Element: TThemedElement): HTHEME; begin if (FThemeData[Element] = 0) then - FThemeData[Element] := OpenThemeData(0, ThemeDataNames[Element]); + begin + if (WindowsVersion >= wvVista) then + FThemeData[Element] := OpenThemeData(0, ThemeDataNamesVista[Element]) + else + FThemeData[Element] := OpenThemeData(0, ThemeDataNames[Element]); + end; Result := FThemeData[Element]; end; @@ -301,6 +340,12 @@ begin Brush := CreateSolidBrush(ColorToRGB(clInfoBk)); FillRect(DC, ARect, Brush); DeleteObject(Brush); + end + else + if (Details.Element = teTreeview) and (Details.Part = TVP_HOTGLYPH) and (WindowsVersion < wvVista) then + begin + Details.Part := TVP_GLYPH; + inherited; end; end else diff --git a/lcl/themes.pas b/lcl/themes.pas index f6b5730d8a..8fe7b5cc88 100644 --- a/lcl/themes.pas +++ b/lcl/themes.pas @@ -352,8 +352,9 @@ type ttTreeviewDontCare, ttTreeviewRoot, ttItemNormal, ttItemHot, ttItemSelected, ttItemDisabled, ttItemSelectedNotFocus, - ttGlyphClosed, ttGlyphOpened, - ttBranch + ttGlyphClosed, ttGlyphOpened, + ttBranch, + ttHotGlyphClosed, ttHotGlyphOpened ); // 'Window' theme data @@ -1639,6 +1640,11 @@ begin Part := TVP_BRANCH; Base := Ord(ttBranch); end; + ttHotGlyphClosed..ttHotGlyphOpened: + begin + Part := TVP_HOTGLYPH; + Base := Ord(ttHotGlyphClosed); + end; else Part := 0; Base := 0; @@ -1872,7 +1878,7 @@ begin if Details.Part = TP_SPLITBUTTONDROPDOWN then Result.cx := 12; teTreeView: - if Details.Part = TVP_GLYPH then + if Details.Part in [TVP_GLYPH, TVP_HOTGLYPH] then Result := Size(9, 9); end; end; @@ -2225,7 +2231,10 @@ begin ((Details.Element = teRebar) and (Details.Part >= RP_BAND)) or ((Details.Element = teWindow) and (Details.Part >= WP_SYSBUTTON) and (Details.Part <= WP_MDIHELPBUTTON)) then - Result := Details.State in [2, 6, 10]; + Result := Details.State in [2, 6, 10] + else + if (Details.Element = teTreeview) and (Details.Part = TVP_HOTGLYPH) then + Result := True; end; function TThemeServices.IsChecked(Details: TThemedElementDetails): Boolean;