Lazarus

Announcements => Third party => Topic started by: Alextp on September 18, 2020, 05:07:40 pm

Title: Win32MenuStyler to theme TMainMenu
Post by: Alextp on September 18, 2020, 05:07:40 pm
Just created and posted to wiki:
https://wiki.freepascal.org/Win32MenuStyler

It is not much tested yet, so write issues to Github.
Title: Re: Win32MenuStyler to theme TMainMenu
Post by: lainz on September 18, 2020, 05:21:39 pm
Thanks  :)
Title: Re: Win32MenuStyler to theme TMainMenu
Post by: wp on September 18, 2020, 05:40:38 pm
Is it really required to have unit Windows in the uses clause? Can't the custom drawing be done based on the MenuItem.OnDrawItem event using standard canvas or LCLIntf routines? This way the MenuStyler could become cross-platform.
Title: Re: Win32MenuStyler to theme TMainMenu
Post by: Alextp on September 18, 2020, 05:50:22 pm
But cross-platf version don't work on gtk2. (And must not work on Mac, not tested yet).
I made it- file lazmenustyler.pas in Github.
Title: Re: Win32MenuStyler to theme TMainMenu
Post by: lainz on September 18, 2020, 07:21:00 pm
There is an option to disable it?
So we can enable/disable according to our theme is default or dark?
Title: Re: Win32MenuStyler to theme TMainMenu
Post by: BeanzMaster on September 18, 2020, 08:20:42 pm
Hi, cool  ! +1

It would be nice to do a component (in a small package perhaps) with the record as persistent class in it.
It also would be great to have an option or a method to apply the theme to popupmenu  ;)

Best regards
Title: Re: Win32MenuStyler to theme TMainMenu
Post by: Alextp on September 18, 2020, 09:32:34 pm
- Added demo buttons to change the colors
- Added method ApplyToMenu for PopupMenu, demo shows this in action
Quote
to do a component (in a small package perhaps) with the record as persistent class
Code bloating...
Title: Re: Win32MenuStyler to theme TMainMenu
Post by: circular on September 18, 2020, 10:31:02 pm
In LazPaint, I've added an option to toggle dark mode. For the menu I could use your unit, that would only allow to turn it to dark mode, not to go back to normal.

Hence the question
There is an option to disable it?
So we can enable/disable according to our theme is default or dark?

like UnAppyToMenu method.
Title: Re: Win32MenuStyler to theme TMainMenu
Post by: Alextp on September 18, 2020, 11:01:43 pm
Just added methods
- ResetMenu()
- ResetForm()
Title: Re: Win32MenuStyler to theme TMainMenu
Post by: circular on September 18, 2020, 11:16:58 pm
Cool.

What about the SetMenuInfo, does it need to be cancelled or it doesn't have any effect afterwards?
Title: Re: Win32MenuStyler to theme TMainMenu
Post by: Alextp on September 18, 2020, 11:28:17 pm
New Reset* methods do reset of SetMenuInfo color.
Title: Re: Win32MenuStyler to theme TMainMenu
Post by: Alextp on September 20, 2020, 11:37:00 am
I added more info to wiki:
https://wiki.freepascal.org/Win32MenuStyler#Detailed_info
Title: Re: Win32MenuStyler to theme TMainMenu
Post by: lainz on October 12, 2020, 08:33:46 pm
A final question. How it looks on Windows 7? If someone have that OS please show a screenshot.
Title: Re: Win32MenuStyler to theme TMainMenu
Post by: Alextp on October 12, 2020, 08:38:56 pm
AFAIK it works on Win7 like on all other Win32 OSes. It also works on Ubuntu on Wine.
TinyPortal © 2005-2018