icon-themes/colibre/links.txt | 12 sw/uiconfig/swriter/ui/templatedialog8.ui | 412 +++--------------------------- vcl/osx/salnativewidgets.cxx | 10 vcl/source/control/imivctl.hxx | 11 vcl/source/control/imivctl1.cxx | 109 ++----- vcl/source/control/ivctrl.cxx | 7 vcl/win/gdi/salnativewidgets-luna.cxx | 45 +-- 7 files changed, 128 insertions(+), 478 deletions(-)
New commits: commit 3486101e4996fed94cd3153b7fe7b5fe4b6006ee Author: Xisco Fauli <xiscofa...@libreoffice.org> AuthorDate: Thu Jun 12 16:40:13 2025 +0200 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Fri Jun 13 09:04:13 2025 +0200 Revert "Resolves tdf#163008 - Vertical tabs with small icons" This reverts commit f14064478726b8b35d45654d0162616bf01959ba. Reason for revert: Vertical tab work is going to be in master only. Discussed in https://lists.freedesktop.org/archives/libreoffice/2025-June/093385.html Change-Id: I779e87bc46a2e0f92d4819fd35e24099c1aa7cf0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186421 Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> Tested-by: Jenkins diff --git a/icon-themes/colibre/links.txt b/icon-themes/colibre/links.txt index f81cc12002e0..69cbb9555f8b 100644 --- a/icon-themes/colibre/links.txt +++ b/icon-themes/colibre/links.txt @@ -2792,15 +2792,3 @@ 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 1dfe53048331..a9510e9d842f 100644 --- a/sw/uiconfig/swriter/ui/templatedialog8.ui +++ b/sw/uiconfig/swriter/ui/templatedialog8.ui @@ -124,9 +124,10 @@ <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="GtkBox"> + <object class="GtkGrid"> <property name="visible">True</property> <property name="can-focus">False</property> <child> @@ -135,41 +136,10 @@ </object> </child> <child type="tab"> - <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 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> <packing> <property name="tab-fill">False</property> @@ -177,7 +147,7 @@ </child> <child> <!-- n-columns=1 n-rows=1 --> - <object class="GtkBox"> + <object class="GtkGrid"> <property name="visible">True</property> <property name="can-focus">False</property> <child> @@ -189,41 +159,10 @@ </packing> </child> <child type="tab"> - <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 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> <packing> <property name="position">1</property> @@ -232,7 +171,7 @@ </child> <child> <!-- n-columns=1 n-rows=1 --> - <object class="GtkBox"> + <object class="GtkGrid"> <property name="visible">True</property> <property name="can-focus">False</property> <child> @@ -244,41 +183,10 @@ </packing> </child> <child type="tab"> - <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 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> <packing> <property name="position">2</property> @@ -287,7 +195,7 @@ </child> <child> <!-- n-columns=1 n-rows=1 --> - <object class="GtkBox"> + <object class="GtkGrid"> <property name="visible">True</property> <property name="can-focus">False</property> <child> @@ -299,41 +207,10 @@ </packing> </child> <child type="tab"> - <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 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> <packing> <property name="position">3</property> @@ -342,7 +219,7 @@ </child> <child> <!-- n-columns=1 n-rows=1 --> - <object class="GtkBox"> + <object class="GtkGrid"> <property name="visible">True</property> <property name="can-focus">False</property> <child> @@ -354,41 +231,10 @@ </packing> </child> <child type="tab"> - <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 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> <packing> <property name="position">4</property> @@ -397,7 +243,7 @@ </child> <child> <!-- n-columns=1 n-rows=1 --> - <object class="GtkBox"> + <object class="GtkGrid"> <property name="visible">True</property> <property name="can-focus">False</property> <child> @@ -409,41 +255,10 @@ </packing> </child> <child type="tab"> - <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 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> <packing> <property name="position">5</property> @@ -452,7 +267,7 @@ </child> <child> <!-- n-columns=1 n-rows=1 --> - <object class="GtkBox"> + <object class="GtkGrid"> <property name="visible">True</property> <property name="can-focus">False</property> <child> @@ -464,41 +279,10 @@ </packing> </child> <child type="tab"> - <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 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> <packing> <property name="position">6</property> @@ -507,7 +291,7 @@ </child> <child> <!-- n-columns=1 n-rows=1 --> - <object class="GtkBox"> + <object class="GtkGrid"> <property name="visible">True</property> <property name="can-focus">False</property> <child> @@ -519,41 +303,10 @@ </packing> </child> <child type="tab"> - <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 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> <packing> <property name="position">7</property> @@ -562,7 +315,7 @@ </child> <child> <!-- n-columns=1 n-rows=1 --> - <object class="GtkBox"> + <object class="GtkGrid"> <property name="visible">True</property> <property name="can-focus">False</property> <child> @@ -574,41 +327,10 @@ </packing> </child> <child type="tab"> - <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 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> <packing> <property name="position">8</property> @@ -616,7 +338,8 @@ </packing> </child> <child> - <object class="GtkBox"> + <!-- n-columns=1 n-rows=1 --> + <object class="GtkGrid"> <property name="visible">True</property> <property name="can-focus">False</property> <child> @@ -628,41 +351,10 @@ </packing> </child> <child type="tab"> - <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 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> <packing> <property name="position">9</property> diff --git a/vcl/source/control/imivctl.hxx b/vcl/source/control/imivctl.hxx index a99c54605aa4..10bf068a5ec9 100644 --- a/vcl/source/control/imivctl.hxx +++ b/vcl/source/control/imivctl.hxx @@ -84,6 +84,15 @@ enum class IcnViewFieldType }; +// Data about the focus of entries + +struct LocalFocus +{ + tools::Rectangle aRect; + Color aPenColor; +}; + + typedef sal_uLong GridId; // Implementation-class of IconChoiceCtrl @@ -118,6 +127,7 @@ class SvxIconChoiceCtrl_Impl ImplSVEvent * nUserEventAdjustScrBars; SvxIconChoiceCtrlEntry* pCurHighlightFrame; SvxIconChoiceCtrlEntry* pCursor; + LocalFocus aFocus; // Data for focusrect bool bBoundRectsDirty; @@ -169,6 +179,7 @@ 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 c2aeca1faa63..fd92b465ef3f 100644 --- a/vcl/source/control/imivctl1.cxx +++ b/vcl/source/control/imivctl1.cxx @@ -80,8 +80,7 @@ SvxIconChoiceCtrl_Impl::SvxIconChoiceCtrl_Impl( aVisRectChangedIdle.SetInvokeHandler(LINK(this,SvxIconChoiceCtrl_Impl,VisRectChangedHdl)); Clear( true ); - // TODO: gridSize and aImageSize depending on the actual image size - Size gridSize(140, (nWinStyle & WB_SMALLICON) ? 32 : 70); + Size gridSize((nWinStyle & WB_DETAILS) ? 150 : 140, (nWinStyle & WB_DETAILS) ? 26 : 70); if(pView->GetDPIScaleFactor() > 1) { gridSize.setHeight( gridSize.Height() * ( pView->GetDPIScaleFactor()) ); @@ -934,18 +933,10 @@ 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.AdjustX( HOR_DIST_BMP_STRING ); - Size aSize = pEntry->GetImage().GetSizePixel(); - aPos.AdjustY((rRect.GetHeight() - aSize.Height()) / 2 ); - } + aPos.AdjustY((rRect.GetHeight() - aImageSize.Height()) / 2 ); rRenderContext.DrawImage(aPos, pEntry->GetImage()); - } } @@ -990,10 +981,6 @@ 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; @@ -1005,12 +992,7 @@ void SvxIconChoiceCtrl_Impl::PaintEntry(SvxIconChoiceCtrlEntry* pEntry, const Po nState |= ControlState::ROLLOVER; TabitemValue tiValue(aFocusRect, TabBarPosition::Left); - 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, + bNativeOK = rRenderContext.DrawNativeControl(ControlType::TabItem, ControlPart::Entire, aFocusRect, nState, tiValue, OUString()); } @@ -1266,6 +1248,8 @@ void SvxIconChoiceCtrl_Impl::ShowCursor( bool bShow ) pView->HideFocus(); return; } + tools::Rectangle aRect ( CalcFocusRect( pCursor ) ); + /*pView->*/ShowFocus( aRect ); } bool SvxIconChoiceCtrl_Impl::HandleScrollCommand( const CommandEvent& rCmd ) @@ -1635,13 +1619,41 @@ 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) { - const StyleSettings& rSettings = rRenderContext.GetSettings().GetStyleSettings(); - tools::Rectangle aRect(CalcFocusRect(pEntry)); - rRenderContext.SetFillColor(rSettings.GetMenuHighlightColor()); - rRenderContext.SetTextColor(rSettings.GetMenuHighlightTextColor()); - rRenderContext.DrawRect(aRect); + 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); } bool SvxIconChoiceCtrl_Impl::IsMnemonicChar( sal_Unicode cChar, sal_uLong& rPos ) const @@ -1788,12 +1800,6 @@ 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 c0b76a11cc9e..2c4b0fac0c6e 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_SMALLICON) | WB_BORDER | + , m_xChooser(VclPtr<SvtIconChoiceCtrl>::Create(this, WB_3DLOOK | (bWithIcons ? WB_ICON : WB_DETAILS) | 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 8d02fe9f3d14..49111fa35bcf 100644 --- a/vcl/win/gdi/salnativewidgets-luna.cxx +++ b/vcl/win/gdi/salnativewidgets-luna.cxx @@ -1071,12 +1071,16 @@ 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()) @@ -1087,7 +1091,20 @@ 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 ) @@ -1100,25 +1117,10 @@ static bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc, if (bCanUseThemeColors || bUseDarkMode) { Color aColor; - 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; - } - + if (iState == TILES_SELECTED) + aColor = Application::GetSettings().GetStyleSettings().GetActiveTabColor(); + else + aColor = Application::GetSettings().GetStyleSettings().GetInactiveTabColor(); ScopedHBRUSH hbrush(CreateSolidBrush(RGB(aColor.GetRed(), aColor.GetGreen(), aColor.GetBlue()))); @@ -1137,8 +1139,7 @@ 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; - if (nPart == ControlPart::Entire) //only for horizontal tabs - Polyline(hDC, apt, SAL_N_ELEMENTS(apt)); + Polyline(hDC, apt, SAL_N_ELEMENTS(apt)); return true; } @@ -1584,6 +1585,8 @@ 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); commit 01c02f3e3affec317bf5eb2de087dbe3dc556cc1 Author: Xisco Fauli <xiscofa...@libreoffice.org> AuthorDate: Thu Jun 12 16:51:27 2025 +0200 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Fri Jun 13 09:04:07 2025 +0200 Revert "Related: tdf#163008 draw the selected tab using a push button on macOS" This reverts commit 6d4512517a31baf44fe38df7ed66414684b71088. Reason for revert: Vertical tab work is going to be in master only. Discussed in https://lists.freedesktop.org/archives/libreoffice/2025-June/093385.html Change-Id: I10902be6d24088916c961fd866771a94ff1a6adc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186422 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> diff --git a/vcl/osx/salnativewidgets.cxx b/vcl/osx/salnativewidgets.cxx index 44c8877c7695..dd89133353bb 100644 --- a/vcl/osx/salnativewidgets.cxx +++ b/vcl/osx/salnativewidgets.cxx @@ -561,7 +561,7 @@ bool AquaGraphicsBackendBase::performDrawNativeControl(ControlType nType, case ControlType::Pushbutton: { NSControlSize eSizeKind = NSControlSizeRegular; - NSBezelStyle eBezelStyle = NSBezelStylePush; + NSBezelStyle eBezelStyle = NSBezelStyleRounded; PushButtonValue const *pPBVal = aValue.getType() == ControlType::Pushbutton ? static_cast<PushButtonValue const *>(&aValue) : nullptr; @@ -576,12 +576,6 @@ bool AquaGraphicsBackendBase::performDrawNativeControl(ControlType nType, { GetThemeMetric(kThemeMetricPushButtonHeight, &nPaintHeight); } - else if (pPBVal && !pPBVal->mbSingleLine) - { - // If not a single line button, allow the button to expand - // its height - eBezelStyle = NSBezelStyleFlexiblePush; - } else { // A simple square bezel style that can scale to any size @@ -608,7 +602,7 @@ bool AquaGraphicsBackendBase::performDrawNativeControl(ControlType nType, else [pBtn setKeyEquivalent: @""]; - if (eBezelStyle == NSBezelStylePush || eBezelStyle == NSBezelStyleFlexiblePush) + if (eBezelStyle == NSBezelStyleRounded) { int nMargin = RoundedMargin[eSizeKind]; rc.origin.x -= nMargin; diff --git a/vcl/source/control/imivctl1.cxx b/vcl/source/control/imivctl1.cxx index 2239b7301098..c2aeca1faa63 100644 --- a/vcl/source/control/imivctl1.cxx +++ b/vcl/source/control/imivctl1.cxx @@ -962,12 +962,7 @@ void SvxIconChoiceCtrl_Impl::PaintEntry(SvxIconChoiceCtrlEntry* pEntry, const Po const StyleSettings& rSettings = rRenderContext.GetSettings().GetStyleSettings(); vcl::Font aNewFont(rRenderContext.GetFont()); if (bSelected) -#ifdef MACOSX - // On macOS, selected tabs are drawn as default push buttons - aNewFont.SetColor(rSettings.GetDefaultActionButtonPressedRolloverTextColor()); -#else aNewFont.SetColor(rSettings.GetTabHighlightTextColor()); -#endif else if (bMouseHovered) aNewFont.SetColor(rSettings.GetTabRolloverTextColor()); else @@ -994,48 +989,14 @@ void SvxIconChoiceCtrl_Impl::PaintEntry(SvxIconChoiceCtrlEntry* pEntry, const Po tools::Rectangle aFocusRect(CalcFocusRect(pEntry)); bool bNativeOK -#ifdef MACOSX - = rRenderContext.IsNativeControlSupported(ControlType::Pushbutton, ControlPart::Entire); -#else = 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; - ControlPart nPart(ControlPart::Entire); - -#ifdef MACOSX - if (bSelected) - { - // Related: tdf#163008 draw the selected tab using a push button - // On macOS, more closely match the vertical tab style of the - // sidebar in the System Settings application. As of macOS Sequoia, - // the sidebar only shows the default style push button for the - // selected tab. The unselected tabs are only text and images so - // no native control needs to be drawn for unselected tabs. - nState |= ControlState::DEFAULT; - - // Allow the native push button to expand its height to match - // the focus rectangle's height. - PushButtonValue aControlValue; - aControlValue.mbSingleLine = false; - aControlValue.m_bFlatButton = true; - - // Eliminate artifacts when this entry becomes unselected by - // making the push button slightly narrower than the focus - // rectangle so that there is no antialiased pixels drawn - // outside the focus rectangle. - tools::Rectangle aButtonRect(aFocusRect); - if (aButtonRect.GetWidth() > 2) - { - aButtonRect.SetLeft(aButtonRect.Left() + 1); - aButtonRect.SetRight(aButtonRect.Right() - 1); - } - - bNativeOK = rRenderContext.DrawNativeControl(ControlType::Pushbutton, nPart, - aButtonRect, nState, aControlValue, OUString()); - } -#else if (bSelected) nState |= ControlState::SELECTED; if (pEntry->IsFocused()) @@ -1044,13 +1005,13 @@ void SvxIconChoiceCtrl_Impl::PaintEntry(SvxIconChoiceCtrlEntry* pEntry, const Po nState |= ControlState::ROLLOVER; TabitemValue tiValue(aFocusRect, TabBarPosition::Left); + 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()); -#endif } if (!bNativeOK) diff --git a/vcl/source/control/ivctrl.cxx b/vcl/source/control/ivctrl.cxx index 0db00744f9b3..c0b76a11cc9e 100644 --- a/vcl/source/control/ivctrl.cxx +++ b/vcl/source/control/ivctrl.cxx @@ -339,12 +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_SMALLICON) | -#ifdef MACOSX - WB_NOBORDER | -#else - WB_BORDER | -#endif + , 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))