GTK3 Theming modGTK3 Resolves layout corruption under ALL Linux Distros

  1. ‹ Older
  2. 2 years ago

    -image-

    Via VNC looking at the result of the GTK3 Theming result on a Pine64 running Ubuntu 16 LTS with Mate desktop. The VNC-server shows the result on the XFCE4-desktop. As you can see it looks great!

    Just as Tim says: many MANY thanks for this fine solution.:D

  3. Tim J

    29 Sep 2018 Testers, Xojo Pro N. Phoenix, AZ

    And let's not forget @jim m 's dogged determination on the deeper details.

    I've also asked @Jason P to pin this conversation in the Linux target section.

  4. Jürg O

    29 Sep 2018 Testers, Xojo Pro

    @Tim J And let's not forget @jim m 's dogged determination on the deeper details.

    Yup, thanks a lot - also for providing the CSS live editor, which makes it so much more convenient to try different things.

    @Tim J I've also asked @Jason P to pin this conversation in the Linux target section.

    Not with that title, please ;)
    I'd like to see this to be added to the example projects (in Platform-Specific/Linux/GTK3 Themes) that come along with Xojo.

  5. Tim J

    29 Sep 2018 Testers, Xojo Pro N. Phoenix, AZ

    @Jürg O Not with that title, please ;)
    I'd like to see this to be added to the example projects (in Platform-Specific/Linux/GTK3 Themes) that come along with Xojo.

    Why don't you start a fresh thread that introduces the modGTK3 module and we'll ask that they pin THAT one :).

  6. Tim J

    29 Sep 2018 Testers, Xojo Pro N. Phoenix, AZ

    ... and, I changed the name :P

  7. Jürg O

    30 Sep 2018 Testers, Xojo Pro Answer

    Since 2017r2, Xojo uses GTK3 for Linux. The default GTK3 Controls are quite big. That makes a cross platform layout quite difficult.
    This example Xojo project shows how one can style Controls using CSS in Xojo-built Applications. The example is trying to just set a minimal amount of styles, so that Controls can be sized at .Height=26 and look good on most Linux distributions.
    This is achieved in two steps: A global theme, and some tweaks for a couple of Controls.

    Many thanks to @jim m for digging in the deeper details providing the CSS live editor, which makes it so much more convenient to try different style adjustments!

    The example Xojo project includes a Module modGTK3. All the required Declares and Styles are in there. If you intend to use it in your own projects, have a look at where the global theme is set, and where/how the Control tweaks are set:

    1. App.Open -> modGTK3.InitGlobalGTK3Style()
    2. Control.Open -> me.InitGTK3Control()

    Note: modGTK3 extends InitGTK3Control for Controls. In this example project, it's called from Control Subclasses. Subclassing your Controls is highly recommended anyway, as you get a single place for tweaks and workarounds for different XojoVersions or BuildTargets.

  8. Jürg O

    30 Sep 2018 Testers, Xojo Pro

    You're probably wondering about the reply above ;)
    The main reason is that I usually don't keep my DropBox links alive for long... so I've moved the example project to a Webserver, where my "Xojo - some pieces 4u" are available.

    @Tim J I've also asked @Jason P to pin this conversation in the Linux target section.

    Since it is (for now), maybe you could mark it as the answer? So a link to the example project is right on top.

  9. Tim J

    30 Sep 2018 Testers, Xojo Pro N. Phoenix, AZ

    @Jürg O Since it is (for now), maybe you could mark it as the answer? So a link to the example project is right on top.

    Done!

  10. Garry P

    3 Oct 2018 Testers, Xojo Pro Europe (Torquay, UK)

    Such a fantastic job with this module. Well done!

  11. jim m

    3 Oct 2018 Testers, Xojo Pro piDog.com

    Hey guys. I did a bunch more work on this (kind of got lost in it over the weekend)

    I eliminated the need to subclass controls by adding handlers for the GtkWidget and GtkEntry classes 'map' signals. All controls' height will be set to be at least their default 'min-height' property (not the css value) and all GtkEntries will have char-width set to zero.

    Added conditional parsing for the CSS. #IF - #END IF style

    I added a css nodes viewer and a GtkWidget properties viewer.

    I put up a BitBucket of the project . Please take a look and add css for any quirks you find for specific distro's, OS's, Desktops and Xojo versions. (Syntax is very simple and explained in the readme.)

    Be sure to add the init methods before any windows are shown or the 'map' signals will be missed.

  12. 11 months ago

    Is this still working? When I add the mod following the instructions, I get an error when compiling:

    GtkCssParsingErrorInfo.LastParsingError Declaration
    There is no class with this name
    Shared LastParsingError As modGTK3.GtkCssParsingErrorInfo

  13. jim m

    5 Jul 2019 Testers, Xojo Pro piDog.com

    That's a very strange error...
    Did you open the modGtk3.xojo_project and copy the module from there or drag it from the downloaded folder?

  14. Tim J

    5 Jul 2019 Testers, Xojo Pro N. Phoenix, AZ

    Did you add the full module to your project? It should look something like this is the Navigator:

    -image-

  15. @jim m That's a very strange error...
    Did you open the modGtk3.xojo_project and copy the module from there or drag it from the downloaded folder?

    I cannot open that, it ask immediately for the location of "Build Automation.xojo_code",which is nowhere to be found.

  16. jim m

    6 Jul 2019 Testers, Xojo Pro piDog.com

    It looks like Build Automation was added to my gitignore file and not uploaded. I've fixed the problem.

  17. @jim m It looks like Build Automation was added to my gitignore file and not uploaded. I've fixed the problem.

    Great, it compiles now error free. Thanks for updating it!

  18. jim m

    7 Jul 2019 Testers, Xojo Pro piDog.com

    Since you got me looking at the project, I've updated the repo to fix a 64bit bug in the demo and to improve tab panel handling to hopefully align contents correctly and aviod clipping.

  19. Massimo V

    7 Jul 2019 Testers, Xojo Pro Europe (Germany, Würzburg)
    Edited 11 months ago

    @Ivan T As my second post states, GTK is NOT designed to work in a fixed layout like apps in windows or Mac. So, the only way Xojo could fix this problem is to implement and expose the GTK native containers. But, doing that, they will break the multiplatform compatibility of the layout designer. So, not an easy solution.

    But, Maybe if Xojo implement GTK in ALL 3 desktop platforms...

    • Lots of contros out of the box for xojo
    • Great Layout widgets to make modern interfaces
    • Awesome performance with hardware accelerated drawing
    • Consistency in all the 3 platforms
    • Cairo Drawing could be used to add PDF capabilities
    • Xojo team will focus in 1 UI instead of 3
    • Apps with themes in all the platforms.
    • Etc

    Feedback Case 52860 - Implement the full GTK widget set and Cairo drawings on all 3 platforms for better multiplatform compatibility

    Gimp On Windows
    -image-

    Gimp On Linux
    -image-

    Gimp On Mac
    -image-

    New Gimp style On Windows
    -image-

    New Gimp style On Windows other theme
    -image-

    Feedback Case 52860 - Implement the full GTK widget set and Cairo drawings on all 3 platforms for better multiplatform compatibility

    I think the idea of using GTK on Mac and Windows would spoil the whole idea of Xojo using native UI.
    And while on Windows this can be doable due there is much more UI look & feel fragmentation, this would be a disaster on Mac. Does someone notice on Mac it looks UGLY?

    I personally don't want my Mac applications looking like that and if Xojo would ever think to implement this, I would probably search for alternatives. There are other cross platform environments around, but all of them fail on the UI due to non native controls, etc.
    This is one of biggest plus of Xojo. It looks great on all platforms.

  20. Garry P

    8 Jul 2019 Testers, Xojo Pro Europe (Torquay, UK)

    I personally don't want my Mac applications looking like that and if Xojo would ever think to implement this, I would probably search for alternatives. There are other cross platform environments around, but all of them fail on the UI due to non native controls, etc.
    This is one of biggest plus of Xojo. It looks great on all platforms.

    Whilst the concept of native GUI controls for each OS is great in practice we actually get the lowest common denominator because there are so many differences between the three desktop platforms. For example, this is probably why we still don’t have a date picker control without having to spend additional money for a third party solution.

    Additionally, because Xojo don’t provide that many controls themselves (because they have to cater for all three platforms with three different GUI toolkits) developers end up with non-native canvas-based hacks to simulate what has already been implemented in a cross-platform toolkit like GTK3.

    Personally, I would have no problem at all if Xojo decided to support GTK3 on all three platforms. That would actually speed up development time for me. Much of my debugging time is spent fixing weird GUI glitches between platforms which would probably be solved if there was just one underlying toolkit. I find the logic side of my apps tends to “just work” as advertised by Xojo but the GUI side is often broken.

    Additionally, even as a die hard macOS user, I really don’t mind the look of GTK3.

    Just my two cents.

  21. Tim J

    8 Jul 2019 Testers, Xojo Pro N. Phoenix, AZ

    @Massimo V I think the idea of using GTK on Mac and Windows would spoil the whole idea of Xojo using native UI.

    But ... if you look at modern Mac apps, you'll discover that they really aren't adhering to any specific look and feel outside of a design that works for them - even Apple's own apps.

  22. Newer ›

or Sign Up to reply!