Coder Social home page Coder Social logo

Comments (10)

eleanor-clifford avatar eleanor-clifford commented on September 15, 2024 1

This is great, can we get a PR? I'd do it myself but I'm a bit short on time nowadays

from freecad.

Chrismettal avatar Chrismettal commented on September 15, 2024

So you removed the "Fix" in your stylesheet and the blank space goes away for you? Can you show us the code you edited?

The stylesheets are basically always created based on another sheet, and not recreated from scratch, so this might potentially be just dead weight carried since inception.

I think there is another "stylesheet" wide bug (?) were tab width is significantly wider for stylesheets, so you need to scroll in the preference menu if kept at default dimensions, for example:

image

WIthout a stylesheet, the default width is perfect to fit all tabs without scrolling:

image

So both of these might be stuff that is copied through all stylesheets since the beginning

from freecad.

MisterMakerNL avatar MisterMakerNL commented on September 15, 2024

Jup, I'll post the link I shared on Twitter for reference: https://forum.freecadweb.org/viewtopic.php?p=597530#p597530
Can find my stylesheet here: https://github.com/MisterMakerNL/ExtremeProDark
MY goal of the stylesheet was to optimize screen-space, so it's all a bit compacted.
afbeelding

from freecad.

Chrismettal avatar Chrismettal commented on September 15, 2024

This goes a bit deeper than I thought.

Yes, all stylesheets have that blank space, yes removing that padding fixes the blank space, but in any case, no stylesheet correctly shows most of the checkboxes in dropdown menus.

Here is the original without any stylesheet:
BoxesNoStylesheet

This is any random stylesheet, showing no boxes but the blank space AFTER the Icon
NoBoxesAnyStylesheet

And this is your fix, removing the blank space as well.
NoBoxes_NoSpace_ExtremeProDark

So, in no stylesheet can we currently see checked items in dropdown menus in the main window right now.
Interestingly, the item at the bottom without any icon has a working checkbox. It is just checkboxes WITH icons that get eaten up.

EDIT:
Related: https://bugreports.qt.io/browse/QTBUG-66380
According to this, styling with boxes and icons is impossible in current QT, and instead the icon (or its frame or background) should show the state. In that case we could remove the blank space and add a colored border showing the icon's state in all stylesheets.

from freecad.

MisterMakerNL avatar MisterMakerNL commented on September 15, 2024

Wow nice work!
Instead of a colored border could we make it look like a pressed in button?
btw this is how it looks on windows in freecad 0.2 without stylesheet.
afbeelding

from freecad.

MisterMakerNL avatar MisterMakerNL commented on September 15, 2024

I think I fixed it! (for windows)
Add this to the qss:
QMenu::icon:checked { /* appearance of a 'checked' icon */
background: gray;
border: 1px inset gray;
position: absolute;
top: 1px;
right: 1px;
bottom: 1px;
left: 1px;
}
above is from the wiki of QT below is what I ended up adding to my theme. Only need some Linux testers!!

QMenu::icon:checked { /* appearance of a 'checked' icon */
    background: #6492d7;
    border: 2px #6492d7;
    position: absolute;
    border-radius: 3px;
}

afbeelding

from freecad.

Chrismettal avatar Chrismettal commented on September 15, 2024

That looks quite good! And matches QTs intention.
I only find the 3 px corner radius a bit much, but that's for your stylesheet to decide. At least for Behave I would keep it smaller, but that I will try out later.

Gonna test on Linux later and implement your fix for the other stylesheets sitting in the FreeCAD source, using a fitting "checked" color for each stylesheet individually, unless you're already on it?

from freecad.

Chrismettal avatar Chrismettal commented on September 15, 2024

Sure thing!

from freecad.

MisterMakerNL avatar MisterMakerNL commented on September 15, 2024

Nice, I am happy it also worked in Linux!

from freecad.

eleanor-clifford avatar eleanor-clifford commented on September 15, 2024

closed by #6

from freecad.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.