Bug 163008 - Vertical tabs ignore layout for icons
Summary: Vertical tabs ignore layout for icons
Status: UNCONFIRMED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: UI (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Vertical-Tab-dialogs
  Show dependency treegraph
 
Reported: 2024-09-17 12:17 UTC by Heiko Tietze
Modified: 2024-09-17 13:49 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Heiko Tietze 2024-09-17 12:17:39 UTC
With gtk3 I can easily place the icon before the text by using a horizontal orientation. This is ignored for kf5/6, gen, and likely other VCL too, and the icon always goes in a vertical orientation.

Test with https://gerrit.libreoffice.org/c/core/+/168685 or change the respective attribute for cui/uiconfig/ui/hyperlinkdialog.ui.
Comment 1 Michael Weghorn 2024-09-17 12:57:29 UTC
(In reply to Heiko Tietze from comment #0)
> Test with https://gerrit.libreoffice.org/c/core/+/168685 or change the
> respective attribute for cui/uiconfig/ui/hyperlinkdialog.ui.

Do I understand correctly that this is something that is/can be set independently for the GtkBox of each single tab child, i.e. the tab control itself doesn't actually handle it, but it just gets a GtkWidget child?

Using `WB_SMALLICON` for the `SvtIconChoiceCtrl` seems to give a similar result to the gtk3 version, but is not configurable per tab child. Sample change to test that:

diff --git a/vcl/source/control/ivctrl.cxx b/vcl/source/control/ivctrl.cxx
index 4566ad1310b9..be5e4c774796 100644
--- a/vcl/source/control/ivctrl.cxx
+++ b/vcl/source/control/ivctrl.cxx
@@ -368,7 +368,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_SMALLICON : WB_DETAILS) | WB_BORDER |
                                                          WB_NOCOLUMNHEADER |
                                                          WB_NODRAGSELECTION | WB_TABSTOP | WB_CLIPCHILDREN |
                                                          WB_NOHSCROLL))

If it were an attribute of the GtkNotebook, switching mode based on that attribute could be an option, but if it's not, I don't see a simple way to make it work in a way that's configurable independently for each single tab child.
Comment 2 Rafael Lima 2024-09-17 13:22:53 UTC
(In reply to Michael Weghorn from comment #1)
> If it were an attribute of the GtkNotebook, switching mode based on that
> attribute could be an option, but if it's not, I don't see a simple way to
> make it work in a way that's configurable independently for each single tab
> child.

Apparently this is set via the "tab-pos" property of the "GtkNotebook", defining the position of all child tabs.

See f.i. the file paradialog.ui in Heiko's patch.
Comment 3 Michael Weghorn 2024-09-17 13:49:25 UTC
(In reply to Rafael Lima from comment #2)
> Apparently this is set via the "tab-pos" property of the "GtkNotebook",
> defining the position of all child tabs.
> 
> See f.i. the file paradialog.ui in Heiko's patch.

As far as I understand, "tab-pos" defines whether the whole tab bar is on the top or on the left, not the position of the icons within the single tab items.
(Changing it to "top" moves the tab bar to the top of the dialog, but leaves the icons left of the text in the individual tab items.)

The GtkNotebook doc [1] also mentions that `tab_label` is a GtkWidget, not just a string/char*, which allows for much more flexibility for each single item.

[1] https://docs.gtk.org/gtk3/method.Notebook.append_page.html