Install new GTK Theme in Windows

Various topics about the game, the website, or anything else Freeciv related that doesn't fit elsewhere.
sveinung
Elite
Posts: 548
Joined: Wed Feb 20, 2013 4:50 pm

Install new GTK Theme in Windows

Post by sveinung »

Warning: I really don't know Windows. The way I did this may be insane, messy, overcomplicated, stupid and horribly inefficient. It may also cause Freeciv to break later.

In the default install on Windows Freeciv use something called GTK to show you the game. It is possible to change how GTK makes Freeciv look by using something called a Theme. I just borrowed a computer running Windows and found two ways to install more themes in the copy of GTK that belongs to Freeciv.

When the folder b is located inside the folder a it can be written a/b (UNIX way) or a\b (Windows way). a/b/c/f.file means that the file f.file is located in the folder c that is located in the folder b that is located in the folder a

Approach 1
  • Go to http://gtk-win.sourceforge.net/home/ind ... /Downloads
  • Download the GTK+ Themes installer, NOT the runtime installer
  • While the file is downloaded find out where Freeciv is installed. On the computer i borrowed it was in C:\Program files (x86)\Freeciv-2.4.0-gtk2
  • Run the installer you just downloaded.
  • When asked to choose components remove the check for GTK2 Preference Utility
  • When asked to choose destination folder choose the folder where Freeciv is installed
  • Start (or load) a Freeciv game.
  • Open the "Game" menu. Select "Options". Select "Local client". The current GTK theme is set to Freeciv. You should now be able to select one of the others.
Approach 2
  • Go to http://gtk-win.sourceforge.net/home/ind ... /Downloads
  • Download the custom package. It is a zip file, not an installer. This way you can decide where to put the various files.
  • While the file is downloaded find out where Freeciv is installed. On the computer i borrowed it was in C:\Program files (x86)\Freeciv-2.4.0-gtk2
  • Open the zip file you just downloaded. It contains the themes.
  • Copy the content of the folder lib/gtk-2.0/2.10.0/engines/ in the zip file to the folder lib/gtk-2.0/2.10.0/engines in the folder where Freeciv is installed
  • Copy the folder share/themes to the folder share in the folder where Freeciv is installed
  • Start (or load) a Freeciv game.
  • Open the "Game" menu. Select "Options". Select "Local client". The current GTK theme is set to Freeciv. You should now be able to select one of the others.
Edited 26th Spetember to fix spelling error in folder names
Last edited by sveinung on Thu Sep 26, 2013 12:00 pm, edited 2 times in total.
cazfi
Elite
Posts: 3077
Joined: Tue Jan 29, 2013 6:54 pm

Re: Install new GTK Theme in Windows

Post by cazfi »

Thanks for testing this. Your instructions are exactly what I would have tested myself. Meanwhile I found the list of themes that are supposed to be included in those theme packages: http://gtk-win.sourceforge.net/home/ind ... in/Details Does that look like the selection you had? (Unfortunately I don't see theme named "MS-Windows" there. There's "Redmond", described as Win9x style theme, though.)
sveinung
Elite
Posts: 548
Joined: Wed Feb 20, 2013 4:50 pm

Re: Install new GTK Theme in Windows

Post by sveinung »

cazfi wrote:Thanks for testing this.
You are welcome.
cazfi wrote:Meanwhile I found the list of themes that are supposed to be included in those theme packages: http://gtk-win.sourceforge.net/home/ind ... in/Details Does that look like the selection you had?
Yes.
cazfi wrote:Unfortunately I don't see theme named "MS-Windows" there.
I think I may have found the reason.
cazfi
Elite
Posts: 3077
Joined: Tue Jan 29, 2013 6:54 pm

Re: Install new GTK Theme in Windows

Post by cazfi »

sveinung wrote:Approach 2
Download the custom package. It is a zip file, not an installer. This way you can decide where to put the various files.
That would be http://downloads.sourceforge.net/gtk-wi ... p?download
sveinung wrote:where Freeciv is installed. On the computer i borrowed it was in C:\Program files (x86)\Freeciv-2.4.0-gtk2
That's the default location, so I assume it below.
sveinung wrote:Copy the content of the folder lib/gtk-2.0/2.10.0/engines/ in the zip file to the folder lib/gtk-2.0/2.10.0/engines in the folder where Freeciv is installed
Copy the folder shared/themes to the folder shared in the folder where Freeciv is installed
I still have not tested this on windows, but this is what I conclude from inspecting contents of the zip:
The zip-file has root directory "gtk2-themes-2009-09-07-win32_bin" that's not going to be part of the path of the files. Directories "lib" and "share" (no 'd') inside it should be copied to C:\Program files (x86)\Freeciv-2.4.0-gtk2. Directories with that name already exist there, we want to just add new files to those directories. You have done this right if you afterwards have files like
C:\Program files (x86)\Freeciv-2.4.0-gtk2\lib\gtk-2.0\2.10.0\engines\libredmond95.dll
C:\Program files (x86)\Freeciv-2.4.0-gtk2\share\themes\Redmond\gtk-2.0\gtkrc
sveinung wrote:Open the "Game" menu. Select "Options". Select "Local client". The current GTK theme is set to Freeciv. You should now be able to select one of the others.
In other words, you start the game once more with the Freeciv theme and only inside the game you can switch the theme.
cazfi
Elite
Posts: 3077
Joined: Tue Jan 29, 2013 6:54 pm

Re: Install new GTK Theme in Windows

Post by cazfi »

I now had quick test of approach 2 (using the .zip). Unfortunately I found no screenshot utility (I have assumed windows has one by default, but blah) from that computer, and, well I were for quick test so didn't hunt one down from the net.

Dozens of themes were available for selection in client settings after I had copied contents of the .zip to correct directories (btw. Windows confirmation dialog used term "merge" when I dragged lib/ and share/ from the .zip file to freeciv-directory where directories with same names already existed), but the changing the selected theme (+ "Apply") didn't really have desired effect - theme change was only partial. Even after I restarted the client, Freeciv theme background image was still in use in most places. It seems that we always apply Freeciv theme first, and selected theme only after that, and most themes do not overwrite some things Freeciv has set. I opened bug #21163 about this.
cazfi
Elite
Posts: 3077
Joined: Tue Jan 29, 2013 6:54 pm

Re: Install new GTK Theme in Windows

Post by cazfi »

I hope we get this fixed to 2.4.1, but meanwhile you can work around the problem by simply moving or renaming <freeciv installation dir>\etc\gtk-2.0\gtkrc so that gtk does not find it. That file currently sets Freeciv theme as system wide default theme (and does nothing else, so it's safe to move away)
User avatar
Arbogast
Elite
Posts: 412
Joined: Tue Jul 16, 2013 9:09 am
Location: France

Re: Install new GTK Theme in Windows

Post by Arbogast »

I also tried sveinung's approach2 helped out with Cazfi's tips and it works just fine. There are over 70 themes! :o
Without removing the GTKRC, most themes produce glitches that are a little eyesores.
Many are similar to each other and overall, they are just the freeciv default theme with new colors. :roll:
cazfi
Elite
Posts: 3077
Joined: Tue Jan 29, 2013 6:54 pm

Re: Install new GTK Theme in Windows

Post by cazfi »

Arbogast wrote:Without removing the GTKRC, most themes produce glitches that are a little eyesores.
Many are similar to each other and overall, they are just the freeciv default theme with new colors. :roll:
Still without removing gtkrc? Yes, then the freeciv theme "leaks" in to other themes.
User avatar
Arbogast
Elite
Posts: 412
Joined: Tue Jul 16, 2013 9:09 am
Location: France

Re: Install new GTK Theme in Windows

Post by Arbogast »

No, no. I meant that "if" not removing the GTKRC, most themes...
I DID remove the culprit and I have looked into a good dozen themes, so far.

EDIT: 107 Themes! But most of them are just color changes.
What I was looking for is better viewing (bigger map), hiding the map with a tab, getting rid of that left column... etc.
My favorite of them all? The FreeCiv default! :mrgreen:
User avatar
HanduMan
Posts: 44
Joined: Sat Feb 02, 2013 9:14 am

Re: Install new GTK Theme in Windows

Post by HanduMan »

Arbogast wrote: What I was looking for is better viewing (bigger map), hiding the map with a tab, getting rid of that left column... etc.
A theme defines how the elements on a window are displayed. It does not define which elements are present.
You can disconnect the "left column" from the main view by clicking on the vertical bar beside it (actually, it conists of two separate pieces, so do it for both) to get a bigger map. Same goes for the chat/message area. If you happen to have an additional display device you could drag those separated portions over there to clear the main map view.
Post Reply