Recent

Author Topic: Can I announce my own package here?  (Read 3594 times)

seany

  • Full Member
  • ***
  • Posts: 120
Can I announce my own package here?
« on: February 11, 2023, 11:19:03 am »
There are some problems of rendering a nice menu in Linux /QT if you are using the default TMenu

I posted several queries, experimenting with it. Thankfully mods allowed all the posts. But none of them solved my concerns. So I am going to create my own TMenu. This seems to take a few baby steps.

Of course, it's not production ready. I want to document my progress here and share with people, if they want it.

# Structure
You enter all the menu items as a double linked list. (Do i need a linked list? I do not know. But I can always quickly refer to *prev* and *next* menu items that way in the same menu level. Professionals, please way in)
The submenu items are children, who are also in a double linked list.

So:

File <--> Edit <--> View <--> etc
|
|
v
New <--> Open <---> Close <--> etc


New is a child of File. New is doubly connected to Open. It is not shown in this picture, but Open is also a child of File, and so on.

# Result
See attachment. The menu now picks up system theme defaults.

I still have to render the submenus, add actions, and so on.

I hope someone will like it.

Github : https://github.com/naturalmechanics/LazarusMenu
My projects, among others:

https://linktr.ee/siderealNight

AlexTP

  • Hero Member
  • *****
  • Posts: 2615
    • UVviewsoft
Re: Can I announce my own package here?
« Reply #1 on: February 11, 2023, 02:19:14 pm »
"I hope someone will like it. "-- Too early to say something, please add drop-down  submenus (of many levels), add checkmarks / radiobuttons. And nice mouse navigation.

seany

  • Full Member
  • ***
  • Posts: 120
Re: Can I announce my own package here?
« Reply #2 on: February 11, 2023, 03:03:00 pm »
Of course.

I first separated the render instructions to a different File. Now I will add actions, then submenu and radio/ check
My projects, among others:

https://linktr.ee/siderealNight

AlexTP

  • Hero Member
  • *****
  • Posts: 2615
    • UVviewsoft
Re: Can I announce my own package here?
« Reply #3 on: February 11, 2023, 03:07:38 pm »
Of course don't forget OnDrawItem event to allow my app to paint anything with any fonts/colors/icons.

seany

  • Full Member
  • ***
  • Posts: 120
Re: Can I announce my own package here?
« Reply #4 on: February 11, 2023, 07:39:41 pm »
Submenu Rendering Working now.

Now I need to add Actions to submenus, deeper submenu levels. and manage the correct color.

My projects, among others:

https://linktr.ee/siderealNight

dbannon

  • Hero Member
  • *****
  • Posts: 3556
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Can I announce my own package here?
« Reply #5 on: February 11, 2023, 11:14:42 pm »
Seany, sounds like you are having fun here. Good. But I wonder if you are aware of the Qt utility, qt5ct ?  Its all about letting you set just about any colour scheme your Qt-hart desires. 

I don't like dark themes myself but I do know a number of my end users do use it, here is the advice I give them to use qt5ct with my app https://github.com/tomboy-notes/tomboy-ng/wiki/Bugs-and-Known-Issues#qt5-versions

Davo
Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

seany

  • Full Member
  • ***
  • Posts: 120
Re: Can I announce my own package here?
« Reply #6 on: February 12, 2023, 10:49:43 am »
Hi

I was not aware, but i did follow the instructions, and did 
Code: Pascal  [Select][+][-]
  1. QT_QPA_PLATFORMTHEME=qt5ct ./myapp
<---- but it does not make any difference.
My distro reports, that your app is on GTK2 - otherwise I would have used it . it looks cool
My projects, among others:

https://linktr.ee/siderealNight

dbannon

  • Hero Member
  • *****
  • Posts: 3556
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Can I announce my own package here?
« Reply #7 on: February 13, 2023, 10:13:44 am »
There are some problems of rendering a nice menu in Linux /QT if you are using the default TMenu
......

??
Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon


dbannon

  • Hero Member
  • *****
  • Posts: 3556
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Can I announce my own package here?
« Reply #9 on: February 13, 2023, 11:11:20 am »
OK, now you have me really confused. Are you making a GTK2 or a QT5 app ? On a KDE system, I would consider using QT5, especially if its underlying Qt5 libraries are 5.15 or later.

However, Lazarus, by default, makes a GTK2 app. Thats fine because many KDE based distros have the GTK2 libraries installed by default and almost all have them available. But qt5ct will have no effect on a GTK2.

Now, if your app is, in fact, a GTK2 one, and its working badly on a KDE distro, I think I would switch it over to Qt5 and see how that looks.

You probably know how to do this already but just in case -
Project-Options->Additions&Overrides.
Add a new build mode (BuildModes button top of window), set one up as a Qt5 mode. LCLWidgetType, click Qt5, it will appear in the grid, ensure there is a tick at the intercection of your new mode and "LCLWidgetType:="qt5". Click OK.

Install libqt5pas1.

Select the mode you want from the speedbutton to left of the green "run" triangle. Note, you do not need Lazarus to be built using Qt5 to make a Qt5 app !

Quote
My distro reports, that your app is on GTK2 - otherwise I would have used it . it looks cool
I'm still confused, do you mean my app, tomboy-ng ?  If so, its available as GTK2, Qt5, Windows and Mac Cocoa (its Lazarus that is cool!).  I have no idea what your distro is but it probably gets its packages from Debian, if so, wait a while, I have started sending Debian Qt5 ones since V0.35. Or download a qt5 version from github.

Davo

Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

seany

  • Full Member
  • ***
  • Posts: 120
Re: Can I announce my own package here?
« Reply #10 on: February 13, 2023, 11:31:30 pm »
"LCLWidgetType:="qt5". Click OK.

Install libqt5pas1.


In my case, it's qt5pas and is installed. There is no difference. The menu still does not pick the correct system theme color. It remains black, and because I am on a dark theme, the menu isn't legible.

Note, you do not need Lazarus to be built using Qt5 to make a Qt5 app !

That's a relief.


I'm still confused, do you mean my app, tomboy-ng ?  If so, its available as GTK2, Qt5, Windows and Mac Cocoa (its Lazarus that is cool!). 

Yup. the package manger tells me, that the app is written in GTK2. But I'll look for a qt5 version.
My projects, among others:

https://linktr.ee/siderealNight

dbannon

  • Hero Member
  • *****
  • Posts: 3556
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Can I announce my own package here?
« Reply #11 on: February 14, 2023, 12:11:35 am »
In my case, it's qt5pas and is installed. There is no difference. The menu still does not pick the correct system theme color. It remains black, and because I am on a dark theme, the menu isn't legible.
You did try using qt5ct with your now Qt5 app ?

Just what OS are you using seany ?  And the theme you are using is a "built in" one ?  I'll try it in a VM if I can.

It really does sound like a theme problem to me. Lazarus GTK2 apps pick up their colours correctly on every OS in my test suite. Qt5 apps don't generally and thats why qt5ct exists. The fact that neither work for you is something of a worry.

As two more easy experiements, please try (using the Qt5 version of you app) -

Code: Pascal  [Select][+][-]
  1. $> QT_QPA_PLATFORMTHEME=gtk3 ./myapp  <enter>
  2.  
  3. $> QT_QPA_PLATFORMTHEME=gtk2 ./myapp <./enter>

(Will have absolutely no effect on the GTK2 version ....)

and lets find out what Qt5 libraries you are using -

Code: Pascal  [Select][+][-]
  1. $> find /usr -name "libQt5Core*" 2>/dev/null   <enter>


Quote
Yup. the package manger tells me, that the app is written in GTK2. But I'll look for a qt5 version.
https://github.com/tomboy-notes/tomboy-ng/wiki/Download_Release

Davo
Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

seany

  • Full Member
  • ***
  • Posts: 120
Re: Can I announce my own package here?
« Reply #12 on: February 14, 2023, 02:09:46 am »
Hi

Code: Pascal  [Select][+][-]
  1. QT_QPA_PLATFORMTHEME=gtk3 ./myapp  <enter>

Has a strange effect, that completely ignores the theme, and creates an app with a light color background and dark text (usual default).

Code: Pascal  [Select][+][-]
  1. QT_QPA_PLATFORMTHEME=gtk2 ./myapp <./enter>

This actually somehow brings the correct color of the menu !

Code: Pascal  [Select][+][-]
  1. QT_QPA_PLATFORMTHEME=qt5ct ./myapp

Menu remains dark.

(All three are done with the qt5 version of the app)

Code: Pascal  [Select][+][-]
  1. ❯ find /usr -name "libQt5Core*" 2>/dev/null
  2. /usr/lib/libQt5Core.so.5.15
  3. /usr/lib/libQt5Core.so.5
  4. /usr/lib/libQt5Core.so.5.15.8
  5. /usr/lib/libQt5Core.prl
  6. /usr/lib/libQt5Core.so
  7.  

Code: Pascal  [Select][+][-]
  1. ❯ uname -a
  2. Linux █ █ █ █ █ █   6.1.11-1-cachyos #1 SMP PREEMPT_DYNAMIC Thu, 09 Feb 2023 14:06:43 +0000 x86_64 GNU/Linux


OS Name . cachyos
Theme : Emerald Dark
« Last Edit: February 14, 2023, 02:13:22 am by seany »
My projects, among others:

https://linktr.ee/siderealNight

dbannon

  • Hero Member
  • *****
  • Posts: 3556
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Can I announce my own package here?
« Reply #13 on: February 15, 2023, 12:51:45 pm »
OK, firstly, I hope you are getting paid well to use cachyos, they could not pay me enough to use it !

I installed a KDE Plasma version but I could not find this Emerald Dark theme. So, I tried both the built-in dark themes (I'm sure they are just as ugly as Emerald Dark), and the Lazarus Menus worked fine with both gtk2 apps and Qt5 ones. But the gtk2 apps seemed to have real problems with some button captions but the Qt5 looked fine.

That leaves me to speculate that your problem may well relate to the theme you have chosen to use. Have you tried any of the other themes available ? Specifically, the "out of the box" ones, Breeze Dark and CachyOS-Nord ?

Rather annoyingly, cachyos did not seem to have libqt5pas in its repositories, I know its in the standard Arch ones. And, of course, I have not made a pacman versions at https://github.com/davidbannon/libqt5pas so I had to manually install the library from a tarball. That means I am using a different libqt5pas than you are, mine has some new features required if you are using Lazarus Main rather than a release version. But I am pretty sure thats not the issue here however.

I guess it remains then for me to try and install the Emerald Dark theme and see if that helps reproduce your problem, where did you get it from ?

Davo
Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

seany

  • Full Member
  • ***
  • Posts: 120
Re: Can I announce my own package here?
« Reply #14 on: February 15, 2023, 10:10:26 pm »
Hi

Thanks for the reply.

If i do  yay emerald theme, it's the first one.: cachyos-emerald-kde-theme-git

Also, I like cachyos very much!

Finally, I found something that is called qt5pas. If i understood correctly, are you saying this is different from your libqt5pas?

PS: There is no problem with breeze. I will try with Cachy Nord and report. EDIT: Cachy nord has the same problem.
« Last Edit: February 15, 2023, 10:46:21 pm by seany »
My projects, among others:

https://linktr.ee/siderealNight

 

TinyPortal © 2005-2018