Get gtk system style color - colors

I am trying to get system style colors.
color = gtk_widget_get_style(window)->
bg[GTK_STATE_NORMAL];
window is my main window and it definitely mapped. I tried with another widgets, GtkStyle's fields and GTK_STATEs, nothing similar to my system style colors.
What I am doing wrong?
Thanks

Related

TextInputLayout hint color for various states

I have been trying to customize the Hint color in TextInputLayout and it works fine. But the problem is that I have to define color when there is an error, normal/Activated which is working and disabled state of the field.
So I tried creating three different styles with color normal, color activated and so on. But this doesn't seem to change the colour. I have indicated the Appcombat theme as the parent theme as well in my custom styles. I have tried applying these styles through java file as well.
Also let me know on how to define the size of the Hint text through style.
A bit late to the party, but here goes my solution to this:
Set the same style in errorTextAppearance and hintTextAppearance, both with the same color for the item android:textColor. When showing an error, set the error using a spannable with a ForegroundColorSpan with the color you wish to display in the error field, while the hint will remain in the color defined by the style set in errorTextAppearance.

Reset background color for QTabWidget

I see that QTabWidget background color is lighter than container widget. How to set its background to same as container widget has? Or better make it transparent?
I have following code:
tabWidget->setPalette(palette());
tabWidget->setBackgroundRole(backgroundRole());
tabWidget->setStyle(style()); // Set parent widget style
QPalette pal = tabWidget->palette();
pal.setColor(QPalette::Base, palette().background().color());
tabWidget->setPalette(pal);
which worked for me with QTreeWidget, however does not work for QTabWidget. Why Qt makes it different?
Solved by setting autoFillBackground to true in UI. However tabs titles background still white - any way to solve?

Remove terminal border colors from vim colorschemes

I want the color scheme to span completely across the terminal boundaries. I am using Color Scheme Scroller Plugin to switch between different theme. I have uploaded a .gif file so that you can clearly see what I want to get fixed. Vim colorschemes doesn't completely change the color of editor. There are some terminal color's borders left around the vim's overridden color scheme. How would I fix it.
Please check the image on this link. Stackoverflow doesn't allow uploading an image > 2Mb
You can't do that from Vim itself.
Terminal emulators use that padding to preserve readability when characters are displayed next to the borders of the window. The programs you run in your terminal have no knowledge of that padding and thus no ability to change it.
But you can read the documentation of your terminal emulator or take a look at its source code to find a way to enable/adjust/disable that padding.
FWIW, there's no way to change that in Terminal but it can be done for iTerm.
Alternatively, you could simply set the background color of your terminal to the one used in your vim colorscheme.
The image appears to depict behavior outside vim's control:
it is using a terminal emulator (could be xterm, could be some other).
the terminal emulator draws character cells on a window
those cells form a grid; the window may extend beyond the grid
the window can have a background color
the grid can have a background color
within the grid, most terminals provide some capability of drawing text with specific foreground and background colors
the grid can have a default background color which is not any of the specified colors
outside the grid, the window can also have a default background color
normally, the grid- and window-default backgrounds are the same
the window can be resized to (more or less) arbitrary sizes
the grid is constrained to exact character sizes
because of this difference, the window can have areas outside the grid which use its default color, and not match the grid's background color.
escape sequences which could affect the grid- and window-background colors are doing erases (see for example the ncurses FAQ My terminal shows some uncolored spaces).
though it is conceivable that erasures within the grid could affect those outside areas, doing that generally leads to odd visual effects.

Qt: Setting TableView Highlight color in Linux

I’m using PyQt4/PySide, but this problem occurs in both, so I think it’s a Qt problem generally. I have a TableView. When I want to set the background color of highlighted table items in Windows, I can get the TableView’s palette and call
palette.setColor(QPalette.Highlight, QColor(someColor))
and that sets the background color of a highlighted item, no problem. However, this does not work in Linux. (Specifically the different versions of Ubuntu that I’ve tried.) Instead the highlighted color is always an orange color that Ubuntu likes to use. Is there a way to fix this? Setting other types of colors, such as QPalette.Text, works fine, it’s a QPalette.Highlight issue only.

Changing the color of an EditorGUI.ProgressBar?

I want to show a ProgressBar. I am using this code:
EditorGUI.ProgressBar(Rect(3,45,100-6,20),20/700.0, "Armor");
I want to change the color of the ProgressBar from a light blue color to a red color. How can I do this?
As it stands, it doesn't appear that you can. However, I had a similar issue where I wanted a very customized bar with different colors to denote different things. I ended up using EditorGUI.DrawPreviewTexture. If you initialize the colors you want to use as a Texture2D, then pass them into that function with the properly placed rectangles, you can create portions of a bar that can change size and location to give the appearance of a standalone progress bar, especially if you keep the positions and size updated in the Update() function.

Resources