[Bug 160349] Add toolbar icons to change UI and scheme to switch Light/Dark
bugzilla-daemon at bugs.documentfoundation.org
bugzilla-daemon at bugs.documentfoundation.org
Thu Apr 4 13:26:35 UTC 2024
https://bugs.documentfoundation.org/show_bug.cgi?id=160349
--- Comment #3 from Rafael Lima <rafael.palma.lima at gmail.com> ---
FTR this is the macro that I created to change the Appearance option. It does
change the appearance option in the registry, but it does not get applied until
LO is restarted. Hence, AFAIK this cannot be achieved solely via macros.
Sub ToggleDarkLight
Dim oConfigProvider As Object
Dim oConfigAccess As Object
Dim pNode(0) As New com.sun.star.beans.PropertyValue
oConfigProvider =
createUnoService("com.sun.star.configuration.ConfigurationProvider")
pNode(0).Name = "nodepath"
pNode(0).Value = "org.openoffice.Office.Common/Misc"
oConfigAccess =
oConfigProvider.createInstanceWithArguments("com.sun.star.configuration.ConfigurationUpdateAccess",
pNode)
Dim nCurValue As Integer
nCurValue = oConfigAccess.ApplicationAppearance
' Values can be 0: Automatic; 1: Light; 2: Dark
If nCurValue >= 2 Then
oConfigAccess.ApplicationAppearance = 0
Else
oConfigAccess.ApplicationAppearance = nCurValue + 1
End If
oConfigAccess.CommitChanges()
End Sub
--
You are receiving this mail because:
You are on the CC list for the bug.
More information about the Libreoffice-ux-advise
mailing list