Active Topics

 



Notices


Reply
Thread Tools
allnameswereout's Avatar
Posts: 3,397 | Thanked: 1,212 times | Joined on Jul 2008 @ Netherlands
#1
Hi, something in Load-Applet pisses me off (besides that it doesn't always show applications using 100% CPU), it is that when I select the button of the panel (statusbar applet...) doesn't light up according to theme like the rest of the panel icons do. How do I solved this? I looked a bit around in the source but I don't have a clue because I don't see anything wrong in it compared to other applications or the Maemo Diablo reference documentation.
__________________
Goosfraba! All text written by allnameswereout is public domain unless stated otherwise. Thank you for sharing your output!
 
Posts: 1,208 | Thanked: 1,028 times | Joined on Oct 2007
#2
Didn't look at the sources but it probably needs something like this:

Code:
 button.set_name("hildon-navigator-button-one")
That's from python source, but it's trivial to convert to C
 
allnameswereout's Avatar
Posts: 3,397 | Thanked: 1,212 times | Joined on Jul 2008 @ Netherlands
#3
That is equiv to gtk_widget_set_name

This is set early in the C file. I think it is something else. Maybe it is artifact from older Maemo not correct ported to newer Maemo.

But I don't see a difference with advanced-backlight which would explain the problem...
__________________
Goosfraba! All text written by allnameswereout is public domain unless stated otherwise. Thank you for sharing your output!
 
Posts: 1,208 | Thanked: 1,028 times | Joined on Oct 2007
#4
Are we talking about load-applet_0.8.2-3? I don't see anything about gtk_widget_set_name or "hildon-navigator-button-one" there.
 
allnameswereout's Avatar
Posts: 3,397 | Thanked: 1,212 times | Joined on Jul 2008 @ Netherlands
#5
Hmm you're right, there is no gtk_window_* defined. But hildon-navigator-button-one is not used in advanced-backlight either.

Advanced Backlight does this

/* Create menu window and set its style */
priv->menu = gtk_window_new (GTK_WINDOW_POPUP);
gtk_window_set_type_hint (GTK_WINDOW (priv->menu), GDK_WINDOW_TYPE_HINT_MENU);
gtk_window_set_is_temporary (GTK_WINDOW (priv->menu), TRUE);
gtk_widget_set_name (priv->menu, "hildon-status-bar-popup");
gtk_window_set_resizable (GTK_WINDOW (priv->menu), FALSE);
gtk_window_set_decorated (GTK_WINDOW (priv->menu), FALSE);
gtk_container_set_border_width (GTK_CONTAINER (priv->menu), HILDON_STATUS_BAR_BORDER_WIDTH);
and Load Applet does e.g. this:

void*
load_initialize(HildonStatusBarItem *item,
GtkWidget **button)
{
osso_return_t status;
So I think the latter is based on Maemo 3.x or at least that style

But then still, gtk_widget_set_name just sets the name of the widget, why would that be related to the applet/panel being active?
__________________
Goosfraba! All text written by allnameswereout is public domain unless stated otherwise. Thank you for sharing your output!
 
qwerty12's Avatar
Posts: 4,274 | Thanked: 5,358 times | Joined on Sep 2007 @ Looking at y'all and sighing
#6
I've been wondering the same actually, glad you brought this up. My hunch is this:

HD_DEFINE_PLUGIN (AdvancedBacklightPlugin, advanced_backlight_plugin, STATUSBAR_TYPE_ITEM);
HD_DEFINE_PLUGIN(OssoStatusbarCpu,
osso_statusbar_cpu,
STATUSBAR_TYPE_ITEM);
These are both set in applets that do "light up" properly but not loadapplet. After sending mypaint to the autobuilder, i'll test out my hunch in about 5 hours when i can use my computer
 
Posts: 1,208 | Thanked: 1,028 times | Joined on Oct 2007
#7
Originally Posted by allnameswereout View Post
But then still, gtk_widget_set_name just sets the name of the widget, why would that be related to the applet/panel being active?
You are actually right, it doesn't do anything even in python statusbar applet. But for python home applets setting name was required before theming worked (partially).
 
qwerty12's Avatar
Posts: 4,274 | Thanked: 5,358 times | Joined on Sep 2007 @ Looking at y'all and sighing
#8
Originally Posted by qwerty12 View Post
I've been wondering the same actually, glad you brought this up. My hunch is this:





These are both set in applets that do "light up" properly but not loadapplet. After sending mypaint to the autobuilder, i'll test out my hunch in about 5 hours when i can use my computer
Can't verify if this is the case...

I did this to the source, compiled fine but the load applet doesn't display then. If using classes is the right way, then the whole source will have to be changed to reflect that...

Code:
--- load-applet-0.8.2.orig/load-applet.c
+++ load-applet-0.8.2/load-applet.c
@@ -60,6 +60,8 @@
 #include <hildon/hildon-help.h>
 #include <hildon/hildon-banner.h>
 #include <libhildondesktop/hildon-status-bar-item.h>
+#include <libhildondesktop/libhildondesktop.h>
+#include <libhildonwm/hd-wm.h>
 #include <hildon/hildon-number-editor.h>
 #include <gtk/gtkenums.h>
 
@@ -135,6 +137,12 @@
     osso_context_t *osso_context;
 } PluginInfo;
 
+typedef struct
+{
+  HildonStatusBarItemClass parent_class;
+} PluginInfoClass;
+
+HD_DEFINE_PLUGIN(PluginInfo, plugin_info, STATUSBAR_TYPE_ITEM);
 
 static gint lastU, lastN, lastIO, lastI;
 gint deltaU, deltaN, deltaIO, deltaI;
--- load-applet-0.8.2.orig/configure.ac
+++ load-applet-0.8.2/configure.ac
@@ -38,7 +38,9 @@
 AC_SUBST(HILDONHELP_LIBS)
 AC_SUBST(HILDONHELP_CFLAGS)
 
-PKG_CHECK_MODULES(HILDON, hildon-1 >= 1.0.0)
+PKG_CHECK_MODULES(HILDON, 
+		 [hildon-1 >= 1.0.0
+		  libhildonwm >= 0])
 AC_SUBST(HILDON_LIBS)
 AC_SUBST(HILDON_CFLAGS)
If anyone is interested, here are applets that "light up" properly:

Last edited by qwerty12; 2008-12-14 at 11:29.
 
allnameswereout's Avatar
Posts: 3,397 | Thanked: 1,212 times | Joined on Jul 2008 @ Netherlands
#9
API changes between maemo 3.2 and maemo 4.0

Note also that Hildon Application Framework is now called Hildon and Maemo Desktop (same as maemo-af-desktop) has been renamed to Hildon Desktop.

Renamed packages:
Hildon-fm -> libhildonfm2 (pkg-config name hildon-fm-2)
Hildon-libs -> libhildon1 (pkg-config name hildon-1)
Libossomime0 -> libhildonmime0
Maemo-af-desktop -> hildon-desktop
libosso-help -> libhildonhelp0 (pkg-config name hildon-help)

Removed packages:
Lessertunjo & archtunjo (combined to hildon-games-wrapper)
Hildon-lgpl & Hildon-libs (merged to libhildon1)
Libhildonmenu0 (replaced with libhildondesktop0, pkg-config name libhildondesktop)
Hildon-base-lib (GnomeVFS to be used instead)
Hildon-status-bar-lib (statusbar plugins should link against libhildondesktop)
So I think one would have to link the plugin against libhildondesktop.
__________________
Goosfraba! All text written by allnameswereout is public domain unless stated otherwise. Thank you for sharing your output!
 
daperl's Avatar
Posts: 2,427 | Thanked: 2,986 times | Joined on Dec 2007
#10
IIRC, you don't get this functionality for free. For example, the Advanced Backlight Applet toggles the icon based on the active/inactive state of the "menu." I can point you at the code if I must, but it's in there.

EDIT: Here's the call:

gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->button), ...
There's other code to help set this up of course...
__________________
N9: Go white or go home

Last edited by daperl; 2008-12-14 at 20:08.
 
Reply


 
Forum Jump


All times are GMT. The time now is 23:06.