icon-themes/colibre/links.txt | 12 sw/uiconfig/swriter/ui/templatedialog8.ui | 412 ++++++++++++++++++++++++++---- vcl/source/control/imivctl.hxx | 11 vcl/source/control/imivctl1.cxx | 70 ++--- vcl/source/control/ivctrl.cxx | 2 vcl/win/gdi/salnativewidgets-luna.cxx | 45 +-- 6 files changed, 426 insertions(+), 126 deletions(-)
New commits: commit b787dfcc08af0ae1358c69fe4fcbd50af4f444d5 Author: Heiko Tietze <[email protected]> AuthorDate: Wed Jun 4 12:23:21 2025 +0200 Commit: Heiko Tietze <[email protected]> CommitDate: Tue Jun 10 16:04:10 2025 +0200 Resolves tdf#163008 - Vertical tabs with small icons GtkNotebook with the property groupname == "icons" arranges the content for large icons above text. The patch changes WB_DETAILS to WB_SMALLICON and optimzes the arrangement for horizontal layout with icons <32px The attribute enable-popup is false to suppress Gtk3's context menu for the available tabs as this menu is filled via the first item (at least the box as first item in a tab results in empty label) Change-Id: Ib575ad248aac304df27a9d1c2037d847cce167ae Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186191 Reviewed-by: Heiko Tietze <[email protected]> Tested-by: Jenkins diff --git a/icon-themes/colibre/links.txt b/icon-themes/colibre/links.txt index 69cbb9555f8b..f81cc12002e0 100644 --- a/icon-themes/colibre/links.txt +++ b/icon-themes/colibre/links.txt @@ -2792,3 +2792,15 @@ cmd/sc_formatline-more.png sfx2/res/symphony/open_more.png cmd/32/tabletransformdialog.png cmd/32/transformdialog.png cmd/lc_tabletransformdialog.png cmd/lc_transformdialog.png cmd/sc_tabletransformdialog.png cmd/sc_transformdialog.png + +# templatedialog8 +res/organizer.png cmd/lc_browseview.png +res/page.png cmd/lc_attributepagesize.png +res/area.png cmd/lc_backgroundcolor.png +res/transparence.png cmd/lc_graftransparence.png +res/header.png cmd/lc_insertheader.png +res/footer.png cmd/lc_insertfooter.png +res/borders.png cmd/lc_borderdialog.png +res/columns.png cmd/lc_pagecolumntype.png +res/footnotes.png cmd/lc_footnotedialog.png +res/textgrid.png cmd/lc_gridvisible.png diff --git a/sw/uiconfig/swriter/ui/templatedialog8.ui b/sw/uiconfig/swriter/ui/templatedialog8.ui index a9510e9d842f..1dfe53048331 100644 --- a/sw/uiconfig/swriter/ui/templatedialog8.ui +++ b/sw/uiconfig/swriter/ui/templatedialog8.ui @@ -124,10 +124,9 @@ <property name="vexpand">True</property> <property name="tab-pos">left</property> <property name="scrollable">True</property> - <property name="enable-popup">True</property> <child> <!-- n-columns=1 n-rows=1 --> - <object class="GtkGrid"> + <object class="GtkBox"> <property name="visible">True</property> <property name="can-focus">False</property> <child> @@ -136,10 +135,41 @@ </object> </child> <child type="tab"> - <object class="GtkLabel" id="organizer"> - <property name="visible">True</property> - <property name="can-focus">True</property> - <property name="label" translatable="yes" context="templatedialog8|organizer">General</property> + <object class="GtkBox" id="organizer"> + <property name="can-focus">False</property> + <property name="spacing">3</property> + <child> + <object class="GtkImage" id="imOrganizer"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="icon-name">res/organizer.png</property> + <accessibility> + <relation type="labelled-by" target="lbOrganizer"/> + </accessibility> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="lbOrganizer"> + <property name="visible">True</property> + <property name="can-focus">True</property> + <property name="label" translatable="yes" context="templatedialog8|organizer">General</property> + <property name="use-underline">True</property> + <property name="mnemonic-widget">organizer</property> + <accessibility> + <relation type="label-for" target="imOrganizer"/> + </accessibility> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> </object> <packing> <property name="tab-fill">False</property> @@ -147,7 +177,7 @@ </child> <child> <!-- n-columns=1 n-rows=1 --> - <object class="GtkGrid"> + <object class="GtkBox"> <property name="visible">True</property> <property name="can-focus">False</property> <child> @@ -159,10 +189,41 @@ </packing> </child> <child type="tab"> - <object class="GtkLabel" id="page"> - <property name="visible">True</property> - <property name="can-focus">True</property> - <property name="label" translatable="yes" context="templatedialog8|page">Page</property> + <object class="GtkBox" id="page"> + <property name="can-focus">False</property> + <property name="spacing">3</property> + <child> + <object class="GtkImage" id="imPage"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="icon-name">res/page.png</property> + <accessibility> + <relation type="labelled-by" target="lbPage"/> + </accessibility> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="lbPage"> + <property name="visible">True</property> + <property name="can-focus">True</property> + <property name="label" translatable="yes" context="templatedialog8|page">Page</property> + <property name="use-underline">True</property> + <property name="mnemonic-widget">page</property> + <accessibility> + <relation type="label-for" target="imPage"/> + </accessibility> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> </object> <packing> <property name="position">1</property> @@ -171,7 +232,7 @@ </child> <child> <!-- n-columns=1 n-rows=1 --> - <object class="GtkGrid"> + <object class="GtkBox"> <property name="visible">True</property> <property name="can-focus">False</property> <child> @@ -183,10 +244,41 @@ </packing> </child> <child type="tab"> - <object class="GtkLabel" id="area"> - <property name="visible">True</property> - <property name="can-focus">True</property> - <property name="label" translatable="yes" context="templatedialog8|area">Area</property> + <object class="GtkBox" id="area"> + <property name="can-focus">False</property> + <property name="spacing">3</property> + <child> + <object class="GtkImage" id="imArea"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="icon-name">res/area.png</property> + <accessibility> + <relation type="labelled-by" target="lbArea"/> + </accessibility> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="lbArea"> + <property name="visible">True</property> + <property name="can-focus">True</property> + <property name="label" translatable="yes" context="templatedialog8|area">Area</property> + <property name="use-underline">True</property> + <property name="mnemonic-widget">area</property> + <accessibility> + <relation type="label-for" target="imArea"/> + </accessibility> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> </object> <packing> <property name="position">2</property> @@ -195,7 +287,7 @@ </child> <child> <!-- n-columns=1 n-rows=1 --> - <object class="GtkGrid"> + <object class="GtkBox"> <property name="visible">True</property> <property name="can-focus">False</property> <child> @@ -207,10 +299,41 @@ </packing> </child> <child type="tab"> - <object class="GtkLabel" id="transparence"> - <property name="visible">True</property> - <property name="can-focus">True</property> - <property name="label" translatable="yes" context="templatedialog8|transparence">Transparency</property> + <object class="GtkBox" id="transparence"> + <property name="can-focus">False</property> + <property name="spacing">3</property> + <child> + <object class="GtkImage" id="imTransparence"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="icon-name">res/transparence.png</property> + <accessibility> + <relation type="labelled-by" target="lbTransparence"/> + </accessibility> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="lbTransparence"> + <property name="visible">True</property> + <property name="can-focus">True</property> + <property name="label" translatable="yes" context="templatedialog8|transparence">Transparency</property> + <property name="use-underline">True</property> + <property name="mnemonic-widget">transparence</property> + <accessibility> + <relation type="label-for" target="imTransparence"/> + </accessibility> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> </object> <packing> <property name="position">3</property> @@ -219,7 +342,7 @@ </child> <child> <!-- n-columns=1 n-rows=1 --> - <object class="GtkGrid"> + <object class="GtkBox"> <property name="visible">True</property> <property name="can-focus">False</property> <child> @@ -231,10 +354,41 @@ </packing> </child> <child type="tab"> - <object class="GtkLabel" id="header"> - <property name="visible">True</property> - <property name="can-focus">True</property> - <property name="label" translatable="yes" context="templatedialog8|header">Header</property> + <object class="GtkBox" id="header"> + <property name="can-focus">False</property> + <property name="spacing">3</property> + <child> + <object class="GtkImage" id="imHeader"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="icon-name">res/header.png</property> + <accessibility> + <relation type="labelled-by" target="lbHeader"/> + </accessibility> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="lbHeader"> + <property name="visible">True</property> + <property name="can-focus">True</property> + <property name="label" translatable="yes" context="templatedialog8|header">Header</property> + <property name="use-underline">True</property> + <property name="mnemonic-widget">header</property> + <accessibility> + <relation type="label-for" target="imHeader"/> + </accessibility> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> </object> <packing> <property name="position">4</property> @@ -243,7 +397,7 @@ </child> <child> <!-- n-columns=1 n-rows=1 --> - <object class="GtkGrid"> + <object class="GtkBox"> <property name="visible">True</property> <property name="can-focus">False</property> <child> @@ -255,10 +409,41 @@ </packing> </child> <child type="tab"> - <object class="GtkLabel" id="footer"> - <property name="visible">True</property> - <property name="can-focus">True</property> - <property name="label" translatable="yes" context="templatedialog8|footer">Footer</property> + <object class="GtkBox" id="footer"> + <property name="can-focus">False</property> + <property name="spacing">3</property> + <child> + <object class="GtkImage" id="imFooter"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="icon-name">res/footer.png</property> + <accessibility> + <relation type="labelled-by" target="lbFooter"/> + </accessibility> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="lbFooter"> + <property name="visible">True</property> + <property name="can-focus">True</property> + <property name="label" translatable="yes" context="templatedialog8|footer">Footer</property> + <property name="use-underline">True</property> + <property name="mnemonic-widget">footer</property> + <accessibility> + <relation type="label-for" target="imFooter"/> + </accessibility> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> </object> <packing> <property name="position">5</property> @@ -267,7 +452,7 @@ </child> <child> <!-- n-columns=1 n-rows=1 --> - <object class="GtkGrid"> + <object class="GtkBox"> <property name="visible">True</property> <property name="can-focus">False</property> <child> @@ -279,10 +464,41 @@ </packing> </child> <child type="tab"> - <object class="GtkLabel" id="borders"> - <property name="visible">True</property> - <property name="can-focus">True</property> - <property name="label" translatable="yes" context="templatedialog8|borders">Borders</property> + <object class="GtkBox" id="borders"> + <property name="can-focus">False</property> + <property name="spacing">3</property> + <child> + <object class="GtkImage" id="imBorders"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="icon-name">res/borders.png</property> + <accessibility> + <relation type="labelled-by" target="lbBorders"/> + </accessibility> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="lbBorders"> + <property name="visible">True</property> + <property name="can-focus">True</property> + <property name="label" translatable="yes" context="templatedialog8|borders">Borders</property> + <property name="use-underline">True</property> + <property name="mnemonic-widget">borders</property> + <accessibility> + <relation type="label-for" target="imBorders"/> + </accessibility> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> </object> <packing> <property name="position">6</property> @@ -291,7 +507,7 @@ </child> <child> <!-- n-columns=1 n-rows=1 --> - <object class="GtkGrid"> + <object class="GtkBox"> <property name="visible">True</property> <property name="can-focus">False</property> <child> @@ -303,10 +519,41 @@ </packing> </child> <child type="tab"> - <object class="GtkLabel" id="columns"> - <property name="visible">True</property> - <property name="can-focus">True</property> - <property name="label" translatable="yes" context="templatedialog8|columns">Columns</property> + <object class="GtkBox" id="columns"> + <property name="can-focus">False</property> + <property name="spacing">3</property> + <child> + <object class="GtkImage" id="imColumns"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="icon-name">res/columns.png</property> + <accessibility> + <relation type="labelled-by" target="lbColumns"/> + </accessibility> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="lbColumns"> + <property name="visible">True</property> + <property name="can-focus">True</property> + <property name="label" translatable="yes" context="templatedialog8|columns">Columns</property> + <property name="use-underline">True</property> + <property name="mnemonic-widget">columns</property> + <accessibility> + <relation type="label-for" target="imColumns"/> + </accessibility> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> </object> <packing> <property name="position">7</property> @@ -315,7 +562,7 @@ </child> <child> <!-- n-columns=1 n-rows=1 --> - <object class="GtkGrid"> + <object class="GtkBox"> <property name="visible">True</property> <property name="can-focus">False</property> <child> @@ -327,10 +574,41 @@ </packing> </child> <child type="tab"> - <object class="GtkLabel" id="footnotes"> - <property name="visible">True</property> - <property name="can-focus">True</property> - <property name="label" translatable="yes" context="templatedialog8|footnotes">Footnote</property> + <object class="GtkBox" id="footnotes"> + <property name="can-focus">False</property> + <property name="spacing">3</property> + <child> + <object class="GtkImage" id="imFootnotes"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="icon-name">res/footnotes.png</property> + <accessibility> + <relation type="labelled-by" target="lbFootnotes"/> + </accessibility> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="lbFootnotes"> + <property name="visible">True</property> + <property name="can-focus">True</property> + <property name="label" translatable="yes" context="templatedialog8|footnotes">Footnote</property> + <property name="use-underline">True</property> + <property name="mnemonic-widget">footnotes</property> + <accessibility> + <relation type="label-for" target="imFootnotes"/> + </accessibility> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> </object> <packing> <property name="position">8</property> @@ -338,8 +616,7 @@ </packing> </child> <child> - <!-- n-columns=1 n-rows=1 --> - <object class="GtkGrid"> + <object class="GtkBox"> <property name="visible">True</property> <property name="can-focus">False</property> <child> @@ -351,10 +628,41 @@ </packing> </child> <child type="tab"> - <object class="GtkLabel" id="textgrid"> - <property name="visible">True</property> - <property name="can-focus">True</property> - <property name="label" translatable="yes" context="templatedialog8|textgrid">Text Grid</property> + <object class="GtkBox" id="textgrid"> + <property name="can-focus">False</property> + <property name="spacing">3</property> + <child> + <object class="GtkImage" id="imTextGrid"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="icon-name">res/textgrid.png</property> + <accessibility> + <relation type="labelled-by" target="lbTextGrid"/> + </accessibility> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="lbTextGrid"> + <property name="visible">True</property> + <property name="can-focus">True</property> + <property name="label" translatable="yes" context="templatedialog8|textgrid">Text Grid</property> + <property name="use-underline">True</property> + <property name="mnemonic-widget">textgrid</property> + <accessibility> + <relation type="label-for" target="imTextGrid"/> + </accessibility> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> </object> <packing> <property name="position">9</property> diff --git a/vcl/source/control/imivctl.hxx b/vcl/source/control/imivctl.hxx index 10bf068a5ec9..a99c54605aa4 100644 --- a/vcl/source/control/imivctl.hxx +++ b/vcl/source/control/imivctl.hxx @@ -84,15 +84,6 @@ enum class IcnViewFieldType }; -// Data about the focus of entries - -struct LocalFocus -{ - tools::Rectangle aRect; - Color aPenColor; -}; - - typedef sal_uLong GridId; // Implementation-class of IconChoiceCtrl @@ -127,7 +118,6 @@ class SvxIconChoiceCtrl_Impl ImplSVEvent * nUserEventAdjustScrBars; SvxIconChoiceCtrlEntry* pCurHighlightFrame; SvxIconChoiceCtrlEntry* pCursor; - LocalFocus aFocus; // Data for focusrect bool bBoundRectsDirty; @@ -179,7 +169,6 @@ class SvxIconChoiceCtrl_Impl void VisRectChanged() { aVisRectChangedIdle.Start(); } void SetOrigin( const Point& ); - void ShowFocus ( tools::Rectangle const & rRect ); void DrawFocusRect(vcl::RenderContext& rRenderContext, SvxIconChoiceCtrlEntry* pEntry); bool IsMnemonicChar( sal_Unicode cChar, sal_uLong& rPos ) const; diff --git a/vcl/source/control/imivctl1.cxx b/vcl/source/control/imivctl1.cxx index fd92b465ef3f..c2aeca1faa63 100644 --- a/vcl/source/control/imivctl1.cxx +++ b/vcl/source/control/imivctl1.cxx @@ -80,7 +80,8 @@ SvxIconChoiceCtrl_Impl::SvxIconChoiceCtrl_Impl( aVisRectChangedIdle.SetInvokeHandler(LINK(this,SvxIconChoiceCtrl_Impl,VisRectChangedHdl)); Clear( true ); - Size gridSize((nWinStyle & WB_DETAILS) ? 150 : 140, (nWinStyle & WB_DETAILS) ? 26 : 70); + // TODO: gridSize and aImageSize depending on the actual image size + Size gridSize(140, (nWinStyle & WB_SMALLICON) ? 32 : 70); if(pView->GetDPIScaleFactor() > 1) { gridSize.setHeight( gridSize.Height() * ( pView->GetDPIScaleFactor()) ); @@ -933,10 +934,18 @@ void SvxIconChoiceCtrl_Impl::PaintItem(const tools::Rectangle& rRect, { Point aPos(rRect.TopLeft()); if (nPaintFlags & PAINTFLAG_HOR_CENTERED) + { aPos.AdjustX((rRect.GetWidth() - aImageSize.Width()) / 2 ); + aPos.AdjustY( VER_DIST_BMP_STRING ); + } if (nPaintFlags & PAINTFLAG_VER_CENTERED) - aPos.AdjustY((rRect.GetHeight() - aImageSize.Height()) / 2 ); + { + aPos.AdjustX( HOR_DIST_BMP_STRING ); + Size aSize = pEntry->GetImage().GetSizePixel(); + aPos.AdjustY((rRect.GetHeight() - aSize.Height()) / 2 ); + } rRenderContext.DrawImage(aPos, pEntry->GetImage()); + } } @@ -981,6 +990,10 @@ void SvxIconChoiceCtrl_Impl::PaintEntry(SvxIconChoiceCtrlEntry* pEntry, const Po bool bNativeOK = rRenderContext.IsNativeControlSupported(ControlType::TabItem, ControlPart::Entire); +#ifdef MACOSX + // tabs don't size to the focusrect and are drawn with an obtrusive blue rectangle + bNativeOK = false; +#endif if (bNativeOK) { ControlState nState = ControlState::ENABLED; @@ -992,7 +1005,12 @@ void SvxIconChoiceCtrl_Impl::PaintEntry(SvxIconChoiceCtrlEntry* pEntry, const Po nState |= ControlState::ROLLOVER; TabitemValue tiValue(aFocusRect, TabBarPosition::Left); - bNativeOK = rRenderContext.DrawNativeControl(ControlType::TabItem, ControlPart::Entire, + ControlPart nPart(ControlPart::Entire); +#ifdef _WIN32 + // ControlPart::MenuItem prevents drawing line around tabs under win + nPart = ControlPart::MenuItem; +#endif + bNativeOK = rRenderContext.DrawNativeControl(ControlType::TabItem, nPart, aFocusRect, nState, tiValue, OUString()); } @@ -1248,8 +1266,6 @@ void SvxIconChoiceCtrl_Impl::ShowCursor( bool bShow ) pView->HideFocus(); return; } - tools::Rectangle aRect ( CalcFocusRect( pCursor ) ); - /*pView->*/ShowFocus( aRect ); } bool SvxIconChoiceCtrl_Impl::HandleScrollCommand( const CommandEvent& rCmd ) @@ -1619,41 +1635,13 @@ IMPL_LINK_NOARG(SvxIconChoiceCtrl_Impl, DocRectChangedHdl, Timer *, void) aDocRectChangedIdle.Stop(); } -// Draw my own focusrect, because the focusrect of the outputdevice has got the inverted color -// of the background. But what will we see, if the backgroundcolor is gray ? - We will see -// a gray focusrect on a gray background !!! - -void SvxIconChoiceCtrl_Impl::ShowFocus ( tools::Rectangle const & rRect ) -{ - Color aBkgColor(pView->GetBackground().GetColor()); - Color aPenColor; - sal_uInt16 nColor = ( aBkgColor.GetRed() + aBkgColor.GetGreen() + aBkgColor.GetBlue() ) / 3; - if (nColor > 128) - aPenColor = COL_BLACK; - else - aPenColor = COL_WHITE; - - aFocus.aPenColor = aPenColor; - aFocus.aRect = rRect; -} - void SvxIconChoiceCtrl_Impl::DrawFocusRect(vcl::RenderContext& rRenderContext, SvxIconChoiceCtrlEntry* pEntry) { - tools::Rectangle aRect (CalcFocusRect(pEntry)); - ShowFocus(aRect); - - rRenderContext.SetLineColor(aFocus.aPenColor); - rRenderContext.SetFillColor(); - tools::Polygon aPolygon (aFocus.aRect); - - LineInfo aLineInfo(LineStyle::Dash); - - aLineInfo.SetDashLen(1); - aLineInfo.SetDotLen(1); - aLineInfo.SetDistance(1); - aLineInfo.SetDotCount(1); - - rRenderContext.DrawPolyLine(aPolygon, aLineInfo); + const StyleSettings& rSettings = rRenderContext.GetSettings().GetStyleSettings(); + tools::Rectangle aRect(CalcFocusRect(pEntry)); + rRenderContext.SetFillColor(rSettings.GetMenuHighlightColor()); + rRenderContext.SetTextColor(rSettings.GetMenuHighlightTextColor()); + rRenderContext.DrawRect(aRect); } bool SvxIconChoiceCtrl_Impl::IsMnemonicChar( sal_Unicode cChar, sal_uLong& rPos ) const @@ -1800,6 +1788,12 @@ bool SvxIconChoiceCtrl_Impl::RequestHelp( const HelpEvent& rHEvt ) void SvxIconChoiceCtrl_Impl::DrawHighlightFrame(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect) { + const StyleSettings& rStyles = rRenderContext.GetSettings().GetStyleSettings(); + Color aCol(rStyles.GetHighlightColor()); + aCol.Merge(rStyles.GetFieldColor(), 50); + rRenderContext.SetFillColor(aCol); + rRenderContext.DrawRect(rRect); + DecorationView aDecoView(&rRenderContext); aDecoView.DrawHighlightFrame(rRect); } diff --git a/vcl/source/control/ivctrl.cxx b/vcl/source/control/ivctrl.cxx index 2c4b0fac0c6e..c0b76a11cc9e 100644 --- a/vcl/source/control/ivctrl.cxx +++ b/vcl/source/control/ivctrl.cxx @@ -339,7 +339,7 @@ struct VerticalTabPageData VerticalTabControl::VerticalTabControl(vcl::Window* pParent, bool bWithIcons) : VclHBox(pParent) - , m_xChooser(VclPtr<SvtIconChoiceCtrl>::Create(this, WB_3DLOOK | (bWithIcons ? WB_ICON : WB_DETAILS) | WB_BORDER | + , m_xChooser(VclPtr<SvtIconChoiceCtrl>::Create(this, WB_3DLOOK | (bWithIcons ? WB_ICON : WB_SMALLICON) | WB_BORDER | WB_NOCOLUMNHEADER | WB_NODRAGSELECTION | WB_TABSTOP | WB_CLIPCHILDREN | WB_NOHSCROLL)) diff --git a/vcl/win/gdi/salnativewidgets-luna.cxx b/vcl/win/gdi/salnativewidgets-luna.cxx index 49111fa35bcf..8d02fe9f3d14 100644 --- a/vcl/win/gdi/salnativewidgets-luna.cxx +++ b/vcl/win/gdi/salnativewidgets-luna.cxx @@ -1071,16 +1071,12 @@ static bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc, if( nType == ControlType::TabItem ) { iPart = TABP_TABITEMLEFTEDGE; - rc.bottom--; OSL_ASSERT( aValue.getType() == ControlType::TabItem ); const TabitemValue& rValue = static_cast<const TabitemValue&>(aValue); if (rValue.isBothAligned()) - { iPart = TABP_TABITEMLEFTEDGE; - rc.right--; - } else if (rValue.isLeftAligned()) iPart = TABP_TABITEMLEFTEDGE; else if (rValue.isRightAligned()) @@ -1091,20 +1087,7 @@ static bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc, if( !(nState & ControlState::ENABLED) ) iState = TILES_DISABLED; else if( nState & ControlState::SELECTED ) - { iState = TILES_SELECTED; - // increase the selected tab - rc.left-=2; - if (rValue.isBothAligned()) - { - if (rValue.isLeftAligned() || rValue.isNotAligned()) - rc.right+=2; - if (rValue.isRightAligned()) - rc.right+=1; - } - rc.top-=2; - rc.bottom+=2; - } else if( nState & ControlState::ROLLOVER ) iState = TILES_HOT; else if( nState & ControlState::FOCUSED ) @@ -1117,10 +1100,25 @@ static bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc, if (bCanUseThemeColors || bUseDarkMode) { Color aColor; - if (iState == TILES_SELECTED) - aColor = Application::GetSettings().GetStyleSettings().GetActiveTabColor(); - else - aColor = Application::GetSettings().GetStyleSettings().GetInactiveTabColor(); + switch (iState) + { + case TILES_NORMAL: + aColor = Application::GetSettings().GetStyleSettings().GetActiveTabColor(); + break; + case TILES_DISABLED: + aColor = Application::GetSettings().GetStyleSettings().GetInactiveTabColor(); + break; + case TILES_SELECTED: + aColor = Application::GetSettings().GetStyleSettings().GetAccentColor(); + break; + case TILES_HOT: + aColor = Application::GetSettings().GetStyleSettings().GetMenuBarRolloverColor(); + break; + case TTILES_FOCUSED: + aColor = Application::GetSettings().GetStyleSettings().GetHighlightColor(); + break; + } + ScopedHBRUSH hbrush(CreateSolidBrush(RGB(aColor.GetRed(), aColor.GetGreen(), aColor.GetBlue()))); @@ -1139,7 +1137,8 @@ static bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc, apt[2].y = rc.top; apt[3].x = rc.right; apt[3].y = rc.bottom - 1; - Polyline(hDC, apt, SAL_N_ELEMENTS(apt)); + if (nPart == ControlPart::Entire) //only for horizontal tabs + Polyline(hDC, apt, SAL_N_ELEMENTS(apt)); return true; } @@ -1585,8 +1584,6 @@ bool WinSalGraphics::drawNativeControl( ControlType nType, } break; case ControlType::TabBody: - hTheme = getThemeHandle(mhWnd, L"Tab", mWinSalGraphicsImplBase); - break; case ControlType::TabPane: case ControlType::TabItem: hTheme = getThemeHandle(mhWnd, L"Tab", mWinSalGraphicsImplBase);
