maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Development (https://talk.maemo.org/forumdisplay.php?f=13)
-   -   Desktop widget behaviour when changing sizes. (https://talk.maemo.org/showthread.php?t=36819)

jaeezzy 2009-12-12 00:10

Desktop widget behaviour when changing sizes.
 
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:
http://farm3.static.flickr.com/2522/...02d3d3ac_o.png

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)
http://farm3.static.flickr.com/2554/...f6124f9a_o.png

coreyoconnor 2009-12-12 00:14

Re: Desktop widget behaviour when changing sizes.
 
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 2009-12-12 00:31

Re: Desktop widget behaviour when changing sizes.
 
Quote:

Originally Posted by coreyoconnor (Post 423848)
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

coreyoconnor 2009-12-12 00:45

Re: Desktop widget behaviour when changing sizes.
 
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.

jaeezzy 2009-12-13 03:57

Re: Desktop widget behaviour when changing sizes.
 
Quote:

Originally Posted by coreyoconnor (Post 423878)
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.

coreyoconnor 2009-12-13 18:16

Re: Desktop widget behaviour when changing sizes.
 
Sorry. Got distracted adding gconf support to fat-label. Hopefully I'll be able to poke at it tonight.


All times are GMT. The time now is 22:50.

vBulletin® Version 3.8.8