Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Developing U++ » U++ TheIDE and Library: Releases and ChangeLogs » GTK theming a reality
Re: GTK theming a reality [message #6814 is a reply to message #6813] Wed, 29 November 2006 11:57 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
guido wrote on Wed, 29 November 2006 05:47



Congratulations!

Already working on icon theming? Cool



That is the next step. Actually, there is not too many icons import now (only for message boxes and OK Cancel buttons).

Well, I can also import "common" icons for Cut/Copy/Paste, but maybe I will do so rather on "app demand". There is also a problem with icon size...

Quote:


Currently it shares a problem I got with Firefox 2.0 (1.5 was OK) in that application font is two points too big. I can make it smaller by increasing the Xserver DPI setting from 72 to 120, but than the other GTK apps have tiny fonts.
Could you please tell me, how the font size is retreived?



Sure:

	char *font_name = "";
	GOBJ().g_object_get(GTK().gtk_settings_get_default(), "gtk-font-name", &font_name, NULL);

	const char *q = strrchr(font_name, ' ');
	if(q) {
		int h = atoi(q);
		String face(font_name, q);
		int ii = Font::FindFaceNameIndex(face);
		if(ii < 0)
			if(ToUpper(face[0]) == 'M')
				ii = Font::COURIER;
			else
			if(ToUpper(face[0]) == 'S' && ToUpper(face[1]) == 'e')
				ii = Font::ROMAN;
			else
				ii = Font::ARIAL;
		Draw::SetStdFont(Font(ii, h ? h * 96 / 72 : 13));
	}


(in short, it expects h * 96 / 72 converts retrieved point size to 96dpi screen pixels).

For me, font is exactly as big as in other gnome apps. But as you already noted, I tend to oversimplify things, maybe this simple height retrieval needs to take into account more factors?

Mirek
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: TrayIcon Win32 fixed some misbehaviour....
Next Topic: New Vector optimization reduces Linux executable size by 0.8%
Goto Forum:
  


Current Time: Mon May 06 23:51:58 CEST 2024

Total time taken to generate the page: 0.03669 seconds