Override theme settings of gnome-settings-daemon in GTK - gtk

In a pygtk app, I'm using rc_parse_string to adjust the appearance of my GUI. (Mostly to make it look more native under Windows, and to theme individual widgets.) This, for example, would change the icon theme for my application:
gtk.rc_parse_string("""
gtk-icon-theme-name = "Galaxy"
""")
This works under Windows, but it only works under Linux when gnome-settings-daemon is not running. How do I override the theme settings made by gnome-settings-daemon? (In my application only, without changing system-wide settings!)
(By the way, the same problem occurs when you try to theme an individual app by setting GTK2_RC_FILES. It works for non-native apps like OpenOffice, but fails for native gnome apps as soon as the settings daemon is running.)

I eventually found out how to do it. To override the icon theme:
settings = gtk.settings_get_default()
settings.set_string_property("gtk-icon-theme-name", "galaxy", "")
There is a list of all possible settings in the GtkSettings documentation.
If you want to package the icon theme with your application, add the script directory to the icon search path before changing the property:
theme = gtk.icon_theme_get_default()
theme.prepend_search_path(sys.path[0])

Related

Theme Studio - Third-party icons

I'm creating a large scope theme in Huawei Theme Studio and I'm unable to add third-party icons that I would like to customize.
In the Theme Studio, I am in Icon -> Third-Party Icon and Custom.
In the icon folder which is located in ThemeStudio -> workspace -> mytheme -> icons I tried to add for example: com.instagram.android.png, com.amazon.aa.png, com.android.chrome.png, etc.
Unfortunately, none of them showed up in Theme Studio. I'm attaching a screenshot of the message I got when I was trying to upload them.
Next, I tried to upload icons from Huawei, which the large scope theme does not include. These were com.huawei.gameassistant.png and com.huawei.vdrive.png, and these two appeared in the third-party icons.
Am I doing something wrong, or Huawei doesn't support most third-party icons?
According to the doc, If a theme is designed for phones running EMUI 10.0 or later, its preview images cannot contain the 21 icons below, or content related to GMS such as Google Search. Therefore, you do not need to create these images.

Visual Studio Code theme issue

I am irritated by this. I tried uninstalling all the themes (I guess), but still the theme does not seem to be working.
How do I fix this?
When the IDE is untouched for few seconds, this comes up like the old screen saver we had in Windows covering up the entire VS Code slowly.
It doesn't seem to be a theme in my opinion. Perhaps, some issue with the display driver.
You can always try reinstalling vscode, just make sure to sync your settings if you've customized vscode .
If the issue persists, you can try changing the graphics settings by selecting display settings from Window's right click context menu -> selecting graphics settings and adding VScode to the list by browsing to its exe location, and then select power saving to make vscode use the integrated GPU if you're on a laptop.

How to get native windows decorations on GTK3 on Windows 7+ and MSYS2

I am trying to port my application from linux to windows and I have a problem with theming. In linux this works out of a box, just compile it and application is using good theme and looks native.
I have installed gtkmm3 and gtk3 in MSYS2 and I am building it with CMake. This is OK, I had to copy all dlls to directory with binary to be able to execute it. I did not copy anything else. I am trying to create "unzip and execute" package.
My problem is, that application looks out of place. It does not look native at all. There are shadows around the window, which is fine in Windows10, but in Windows 7 it looks not native. Also several icons are missing.
Even gitk3-demo looks non-native in the same way (but it has at least the minimize/maximize/close icons correct).
So the question is: How can I achieve native look of GTK3 application on Windows? Or at least native window decorations?
Thanks
Thera are two sub-problems: missing icons and setting right theme.
Missing icons
For missing icons it was enough to copy these icons
window-close-symbolic.symbolic.png
window-maximize-symbolic.symbolic.png
window-minimize-symbolic.symbolic.png
from: C:\msys64\mingw32\share\icons\Adwaita\22x22\actions
to: "your executable folder"\share\icons\Adwaita\22x22\actions
Theme
Using win32 native theme
There is actually a built-in native-like theme in GTK3. For using native-like theme just create file "your executable folder"\etc\gtk-3.0\settings.ini with this in it
[Settings]
gtk-theme-name=win32
win32 theme is built in into GTK3 and only three icons from previous step seems to be needed.
On windows 7 this looks as following:
The problem is, that the decorations looks the same even on Windows 10 (including window decorations).
From comment from #andlabs : GTK+ 3 uses the uxtheme.dll APIs to get its Windows look and feel, and unfortunately Microsoft has kept those Windows 7-like for window borders. (more in comments)
You can see Windows 10 Gtk3 application with win32 theme here:
Using non default theme
And if you are not happy with default or win32 theme, you can use custom themes (like this Flat-Pat) from the internet. :) In order to do it you need to create config file:
"your executable folder"\etc\gtk-3.0\settings.ini with this in it
[Settings]
gtk-theme-name=Flat-Plat
and you need to copy the theme files to directory in path of your executable
"your executable folder"\share\themes\Flat-Plat
in that folder, the index.theme file and gtk-x.x folders should be present. Obviously gtk-theme-name and folder name should match.
After you run the executable you should be able to get different theme.
EDIT: So there is a win32 theme built-in, thank you #andlabs
EDIT2: Added screenshots
EDIT3: Added Windows 10 screenshot and corrected facts.
You can set GTK_CSD=0 environment variable to disable client-side window decorations and enable Windows native decorations, which gets rid of the ugly win7-like titlebar, as well as Adwaita-like one.
Actually, Gtk+3 been compatible with Windows 10 and you can use the native windows theme by making this your default theme.
gtk-theme-name = MS-Windows
For people like me who use (activestate) perl, the /share and /etc need to be placed one directory above the perl.exe (say in C:\Perl64 if perl.exe is in C:\Perl64\bin).
While GTK_CSD=0 is doing a fine job for windows frame icons, it seams that default Drag-And-Drop (DND) icons are missing too.
Dragging GtkEntry or GtkTreeView contents shows a drag-icon.
I've prepared a button as drag source under Gtk+-3.24.4. When dragging the button, the mouse cursor disappears and no drag icon is shown.
When using gtk_drag_source_set_icon_pixbuf(bt, pixbuf), the pixbuf appears as drag icon. But doing it this way is only half the job done, because move/copy indicators are missing on the icon.

Change Eclipse window color

I've been using Eclipse for a while now, as we need it in class to work with xml files.
I'm rather a fan of using dark backgrounds, as I find it easyer for the eyes.
I've found this topic on how to change the theme in Eclipse, but this only changes the color scheme in the coding window.
Is there a way to change the entire color scheme for the whole program (sidebars, background color, foreground color, ...) in Eclipse like you have in Visual Studio?
offtopic: I want to do the same in NetBeans
EDIT: finally got it to work, but my color scheme s*cks.
Does anyone have a good scheme I can use or some CSS file I may import?
It would be perfect if it fits with any dark Color Theme (Monokai, NightLion Aptana Theme, Oblivion, Obsidian, Pastel, RecognEyes, Sublime Text 2, Sunburst, Wombat or zenburn). Looking at this list, I notice a lot of themes are dark. Too bad the program itself hasn't got themes (unless the Chrome Theme to change everything ourselves)
If you are using Eclipse 4, you can use the Eclipse 4 Chrome Theme to style everything in the program using CSS (or properties for the most used UI elements).
Many of the colors can be adjusted via Preferences > General > Appearance > Colors and Fonts. For things that are not configurable there, they're controlled by tour operating system color settings.

Eclipse's Package explorer background color follows windows theme. I want to change the color without changing windows' theme. Possible?

Maybe a way to alter the colors locally (as in application dependant)?
A background color of eclipse is white, the same white of windows' active window background color. If I change the color on the theme, eclipse changes to the color.
I want to change this software's color without changing the whole theme (because then every program gets weird colors). Is this possible? I thought that maybe there was a way to apply different windows themes to different programs, or something.
I'm using windows XP, classic windows theme.
Install the "Eclipse 4 Chrome Theme" from
http://marketplace.eclipse.org/content/eclipse-4-chrome-theme
Then you can customize a lot of the Eclipse UI widgets.
But not what you want, at least not out of the box.
For that you should go to the CSS tab (in Eclipse 4 Chrome Theme) and paste this:
Tree, List, Table {
background-color: #202020;
color: #d0d0d0;
}
You can change almost anything, the problem is finding out what, and the fact that some things are bitmaps that you can't change (so if the bitmap is dark and you set a dark background you will "loose" the bitmap)
This list of widgets might help, http://download.eclipse.org/rt/rap/doc/1.5/help/html/reference/theming/index.html but they give you generic info on the widget names, not the Eclipse info (with IDs and all), so be careful :-)
== Very late addition ==
Everything you need in one place, including links to a custom dark theme: http://mihai-nita.net/2013/09/19/dark-eclipse/
Mac Screen Shot Example as of Sept 2013 (please be sure to restart Eclipse after changing file):
Just search "Theme" in the Eclipse Market Place. Install Moonrise. (Should be first option). Then go to the General, appearance, Click on appearance, change theme to moonrise, Then there you go.
Knowing the way the workbench is built, I'm sure your request is not possible on the Eclipse side. You can do this for the editors, because they are StyledText widgets, and you are exposed some preferences to customize these.
The other views are various widgets, some are Trees, some are Text, some are composed from various other widgets. All of them are created with the default constructor which just uses the Windows theme.
I don't know of a way to change every Eclipse window to your color scheme, but I can get you at least as far as changing some of the editing windows...
Open up "Window -> Preferences", then under "General | Editors | Text Editors" you will find a section that will allow you to set the "Appearance color options", Background color is one of those options.
PS: I'm using Eclipse 3.6 (Helios)
Sadly, this is not possible (which is crazy).
However, Aptana Studio (which is an Eclipse derivative) lets you theme the entire IDE.
I did some research and found that actualy it is posible to change all colors, but abit harder.
there are two methods that I found so far.
first since eclipse is using OS themes, you can change your OS background settings, like folder background etc., or just change the whole theme if your using windows, but the downside is that all windowses will be same color, in linux and mac os it is also posible, but in different way, I did read it somewhere, but can't remember where :)
second creating a specific theme for eclipse, for example http://rogerdudler.github.io/eclipse-ui-themes/ or any other theme like google chrome etc.
Install the theme from here as per the instruction in the github:
https:// github.com/guari/eclipse-ui-theme
If you don't like the editor color theme, there are bunch of 'em here
http://eclipsecolorthemes.org/
Combination of both just works like charm for me!