Reply
Thread Tools
jaeezzy's Avatar
Posts: 664 | Thanked: 160 times | Joined on Jul 2008 @ Australia
#1
Hi,
It's been a while now since I'm stuck with this problem: I have a widget and from the settings I want to set the size either large or small. The result I'm getting is kinda satisfactory, but the problem is that the "close" & "settings" button in the edit mode don't fit to the widget like they normally should. They stay within the same range when the widget was first initialized. More problematic is that when the widget is initialized with large display and when normalized later from settings, as the "close" & "settings" buttons are quite beyond the display area, they are unresponsive and nothing happens. I would be very grateful if someone could help/suggest on this one. Below are the screenshots. Thanks:

ALSO, It only uses the main window and the rest are just drawn on the window so no other widgets, just cairo*, pixbufs and pixmaps. However, I've tried using GdkGeometry, gtk_widget_set_size_request() and/just gtk_window_resize() and also the gtk_widget_size_request() as when the widget first initializes it uses this function: (But when using GdkGeometry I set the default size in the _init() function and commented out this one.)
Code:
static void hdp_applet_size_request (GtkWidget *widget, GtkRequisition *requisition)
{
	HdpAppletPrivate *priv;
	priv = HDP_APPLET(widget)->priv;
	if (priv->large_screen_flag){
	  	requisition->width  = HDP_WIDTH;
	  	requisition->height = HDP_HEIGHT;
  	} else{
  		requisition->width  = HDP_WIDTH_NORMAL;
	  	requisition->height = HDP_HEIGHT_NORMAL;
	}
}
all resulting in the same thing as in the screenshots.

When the widget is initialized with normal display and later changed to large:


When the widget is initialized with large display and later changed to normal: (Here "close" button does nothing at all but the "settings" button does response only when clicking at the point where it is connected to the display)

Last edited by jaeezzy; 2009-12-12 at 00:19.
 
Posts: 52 | Thanked: 55 times | Joined on Dec 2009
#2
Well, one option would be to make the initial size small and then offset all drawing in x and y by HILDON_ICON_PIXEL_SIZE_FINGER. This should, I think, place the settings button and close button to the left and above, respectively, of the content. Which would hopefully also have the advantage of keeping them in the same position regardless of the widget size.

Course, this is a hack and assumes a lot about how hildon-home chooses the position for the buttons.
 
jaeezzy's Avatar
Posts: 664 | Thanked: 160 times | Joined on Jul 2008 @ Australia
#3
Originally Posted by coreyoconnor View Post
Well, one option would be to make the initial size small and then offset all drawing in x and y by HILDON_ICON_PIXEL_SIZE_FINGER. This should, I think, place the settings button and close button to the left and above, respectively, of the content. Which would hopefully also have the advantage of keeping them in the same position regardless of the widget size.

Course, this is a hack and assumes a lot about how hildon-home chooses the position for the buttons.
Thanks for the quick reply, I would appreciate if you could elaborate more on this one coz I couldn't make anything out of it. However, I've edited my post about using GdkGeometry and setting the default size of the widget to small size. But as I'm not using any other widgets than the main window itself, GdkGeometry, couldn't help me(or maybe i'm not being able to make use of it). Everything visible are just drawn on the main window. Thanks
 
Posts: 52 | Thanked: 55 times | Joined on Dec 2009
#4
sorry about that! hehe

I'm at work so I don't have a dev environment on hand to try it out. I have a simple widget that should be easy enough for me to test what I described. If it works out I'll let you know.
 

The Following User Says Thank You to coreyoconnor For This Useful Post:
jaeezzy's Avatar
Posts: 664 | Thanked: 160 times | Joined on Jul 2008 @ Australia
#5
Originally Posted by coreyoconnor View Post
sorry about that! hehe

I'm at work so I don't have a dev environment on hand to try it out. I have a simple widget that should be easy enough for me to test what I described. If it works out I'll let you know.
Howz it going?? I'm curious to know the solution or if anyone with the solution plz plz share it to me. Thanks.
 
Posts: 52 | Thanked: 55 times | Joined on Dec 2009
#6
Sorry. Got distracted adding gconf support to fat-label. Hopefully I'll be able to poke at it tonight.
 
Reply


 
Forum Jump


All times are GMT. The time now is 00:11.