Customizing the branch icons on a QtTreePropertyBrowser? - qt

I inherited a code project and am tasked with redesigning the GUI with Qt's Style Sheets.
There is a subclassed QtTreePropertyBrowser which I've styled to change the background colors/font color, but I can't for the life of me figure out how to change the appearance of the branch indicator icons. They're almost invisible on the new dark background, like such:
Doing some googling, I found this example.
But from my experimenting so far, it hasn't worked. Reading the documentation, it seems that QtTreePropertyBrowser inherits from QTreeView, but I don't know why it's not working. Any insights?

Related

Is it somehow possible to get a native Windows menu bar in NW.js applications, or to at least style them?

I've followed this: https://nwjs.readthedocs.io/en/latest/References/Menu/#menu
The result is a very Chromium-looking menu. The items just look... nothing like how I think of Windows menu items. (Even though there are these days a million different styles of them in this FrankensteinOS...)
Is this it? I have to use whatever Chromium thinks is a good looking menu? I cannot style them with CSS or something, at least? For example, if I want them to be "dark mode" instead of bright white? I guess I could implement my own custom Canvas-based pixel-perfect menu, but that's both a ton of work and also will never feel native or quite as "responsive".
The documentation you pointed to is for using the Native OS Menu. This will be different on Linux, OSX, and Windows, and will match the native placement and interactions for that system, including keyboard navigation. Similar to how the minimize/maximize/restore/close buttons are built in and differ on each OS.
You can add your own markup and styling to create a custom menu if you like though, and it will look and act the same on every OS. Similarly, you can create your own markup and styles for the min/max/restore/close buttons, and title bar.
https://github.com/nwutils/frameless-example
If you're not confident in HTML/CSS enough to make a responsive menu yourself, you can use frameworks, like Bootstrap, which come responsive with menu styling out of the box.
https://getbootstrap.com/docs/5.0/components/navbar/

Styling the Busy indicator in QML 2.0

I am using Busy indicator to show intermediate progress and i want to change the color of the circles. I referred Customizing Busy indicator link but this is changing the default animation and other things. Also, It is difficult to understand because there is no explanation for the same.
I just want to change the color and the animations should be the same as default. please suggest.
Since the BusyIndicator actually just uses the palette.dark color, you can easily change it using the following code:
BusyIndicator {
palette.dark: "red"
}
Note that if you use the Material theme, you have to set the Material.accent color Material.accent: "red". And perhaps similar changes apply to other themes.
Fun fact: I found this by looking at the QML files in the Qt folder, for me: Qt/5.12.3/gcc_64/qml/QtQuick/Controls.2

How to change QIcon color?

I am working on a custom control box (that min,max/restore/close button in the top right of your Windows titlebar) for my new application. I use closeIcon = style.standardIcon(QStyle.SP_TitleBarCloseButton) to get the correct icon for them. See the full code here in my other SO question. What I got is a black icon. In which I need the white version when it's in hover state.
Can we .. I don't know, inverse it? Or should I get another icon from QStyle?
This question (and several others) are from the intention of creating a chrome like tab in PyQt application, by hiding the titlebar and reimplementing control box. But it didn't gives the best result. Right now this is my solution to create a chrome like tab in PyQt application. Therefore, I close this question.

GtkButton vs. GtkLabel font relief: how to customise one or the other?

Context
I'm working on an application with PyGtk that would more or less work as a panel, much like gnome-panel. Ideally, on the panel i am making, i want a button without border (NB: i am in the process of learning GUI coding with PyGtk).
Problem
I have understood from another thread as well as documentation that the gtk_button_set_relief(GtkButton, GTK_RELIEF_NONE) cancels the button relief on GTK_STATE_NORMAL only. Hence when hovering the button, relief appears again (side note: this is frankly annoying that such options are partially worked out really).
An alternative to the problem is to use a GtkLabel and make a GtkEventBox its parent and make it function as a button. There is an issue however: while a GtkButton font has a relief, the GtkLabel's has none. See screenshot here below:
From left to right: GtkLabel without font relief and GtkButton with font relief
Questions
Now perhaps you can help me to solve the above with your suggestions. What i am thinking of is:
What is causing the relief of the font on these GtkWidgets: the theme or the Gtk base itself?
How can i add relief to the font of the label? OR
How can i remove the border relief of the button in all states?
More generally, how can can i create my own widget (subclassing either GtkLabel or GtkButton) using PyGtk? (I have seen an example on this thread, but that's C i believe)
Is there any alternative i haven't thought of?
Should i use another GUI library altogether?
Thanks.
Benjamin :)
Edit: the former resize-grip handle issue with GtkEventBox appears to be the effect of a Gtk+ bug.

Advanced Flex custom components for working with graphics and text

I'm looking for a new, modern components with enhanced functionality for working with graphics and text.
For example by mouse over to the text appears a icon click on that appears a panel into which you can change the font, font size, font color, letter-range, etc.
With graphics by pointing resizing handles appear, rotation, reflection, etc.
It sounds like you want to create a custom tooltip, that has the options to change/edit the appearance of the UIComponent that was hovered over. This is a tricky mofo of a component to make. I made a custom tooltip based on a Canvas, that has an item renderer associated with it. If your in earnest, I could probably put together a usable example and post it (on my blog or something).
If you hover over a component, a regular toolip appears, but when you hover over the tooltip, it expands out to a custom tooltip. I used Timer objects with event listeners added.
After that, you'll need to do all the transform stuff. Probably out of the scope of a single StackOverflow question to be honest.

Resources