Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Icons size #4

Merged
merged 3 commits into from
Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion debian/compat

This file was deleted.

16 changes: 5 additions & 11 deletions debian/control
Original file line number Diff line number Diff line change
@@ -1,20 +1,14 @@
Source: hildon-status-menu
Section: x11
Priority: optional
Maintainer: Kimmo Hämäläinen <kimmo.hamalainen@nokia.com>
Build-Depends: debhelper (>= 5), cdbs, pkg-config, libhildon1-dev (>= 2.1.4), libdbus-1-dev (>= 1.0.2), libhildondesktop1-dev (>= 2.1.6), maemo-system-services-dev, maemo-launcher-dev (>= 0.23-1), mce-dev, autoconf, automake, libtool-bin, libdbus-glib-1-dev
Standards-Version: 3.8.0
Maintainer: Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com>
Build-Depends: debhelper-compat (= 13), pkg-config, libhildon1-dev (>= 2.1.4), libdbus-1-dev (>= 1.0.2), libhildondesktop1-dev (>= 2.1.6), maemo-system-services-dev, maemo-launcher-dev (>= 0.23-1), mce-dev, autoconf, automake, libtool-bin, libdbus-glib-1-dev
Standards-Version: 4.5.1
Vcs-Git: https://github.com/maemo-leste/hildon-status-menu.git
Vcs-Browser: https://github.com/maemo-leste/hildon-status-menu

Package: hildon-status-menu
Section: x11
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}, ${launcher:Depends}
Description: Hildon Status Menu application

Package: hildon-status-menu-dbg
Section: devel
Architecture: any
Priority: extra
Depends: hildon-status-menu (= ${source:Version})
Description: Debug symbols for Hildon Status Menu application

22 changes: 17 additions & 5 deletions debian/rules
Original file line number Diff line number Diff line change
@@ -1,16 +1,28 @@
#!/usr/bin/make -f
include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/autotools.mk

#export DH_VERBOSE=1

ifeq (,$(findstring nolauncher,$(DEB_BUILD_OPTIONS)))
DEB_CONFIGURE_EXTRA_FLAGS = --enable-maemo-launcher
endif

DEB_DH_INSTALLCHANGELOGS_ARGS=--no-act

makebuilddir::
AUTOGEN_SUBDIR_MODE=1 NOCONFIGURE=yes ./autogen.sh
CFLAGS += -Werror

%:
dh $@ --with autoreconf

override_dh_autoreconf:
dh_autoreconf --as-needed

override_dh_auto_configure:
dh_auto_configure -- $(DEB_CONFIGURE_EXTRA_FLAGS)

override_dh_auto_install:
dh_auto_install --destdir=debian/tmp

binary-install/hildon-status-menu::
override_dh_install:
dh_install
dh_installxsession -u 'post 15'
dh_maemolauncher
3 changes: 2 additions & 1 deletion src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,10 @@ hildon_status_menu_SOURCES = \
hd-display.c \
hd-display.h

hildon_status_menu_LDFLAGS = \
hildon_status_menu_LDADD = \
$(HILDON_LIBS) \
$(LIBHILDONDESKTOP_LIBS) \
$(GCONF_LIBS) \
$(X11_LIBS) \
$(MAEMO_LAUNCHER_LIBS)
hildon_status_menu_LDFLAGS = -Wl,--as-needed
59 changes: 38 additions & 21 deletions src/hd-status-area.c
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,16 @@ struct _HDStatusAreaPrivate
gboolean status_area_visible;
};

G_DEFINE_TYPE_WITH_CODE (HDStatusArea, hd_status_area, GTK_TYPE_WINDOW, G_ADD_PRIVATE(HDStatusArea));
G_DEFINE_TYPE_WITH_PRIVATE (HDStatusArea, hd_status_area, GTK_TYPE_WINDOW);
#define HD_STATUS_AREA_PRIVATE(o) \
((HDStatusAreaPrivate *)hd_status_area_get_instance_private ((HDStatusArea *)(o)))

static gboolean
button_release_event_cb (GtkWidget *widget,
GdkEventButton *event,
HDStatusArea *status_area)
{
HDStatusAreaPrivate *priv = status_area->priv;
HDStatusAreaPrivate *priv = HD_STATUS_AREA_PRIVATE (status_area);

gtk_widget_show (priv->status_menu);
if (!GTK_WIDGET_VISIBLE (priv->status_menu))
Expand Down Expand Up @@ -126,7 +128,7 @@ is_widget_on_screen (GtkWidget *widget)
static void
update_status_area_visibility (HDStatusArea *status_area)
{
HDStatusAreaPrivate *priv = status_area->priv;
HDStatusAreaPrivate *priv = HD_STATUS_AREA_PRIVATE (status_area);
gboolean visible;
GList *l;

Expand Down Expand Up @@ -163,13 +165,10 @@ configure_event_cb (GtkWidget *widget,
static void
hd_status_area_init (HDStatusArea *status_area)
{
HDStatusAreaPrivate *priv = (HDStatusAreaPrivate*)hd_status_area_get_instance_private(status_area);
HDStatusAreaPrivate *priv = HD_STATUS_AREA_PRIVATE (status_area);
GtkWidget *left_alignment, *main_hbox, *left_hbox, *special_hbox;
guint i;

/* Set priv member */
status_area->priv = priv;

priv->desktop = hd_desktop_get ();
g_signal_connect_swapped (priv->desktop, "task-switcher-show",
G_CALLBACK (update_status_area_visibility), status_area);
Expand Down Expand Up @@ -253,7 +252,7 @@ hd_status_area_constructor (GType type,
construct_properties);

/* Create Status Menu */
priv = HD_STATUS_AREA (object)->priv;
priv = HD_STATUS_AREA_PRIVATE (object);
priv->status_menu = hd_status_menu_new (priv->plugin_manager);

return object;
Expand All @@ -263,7 +262,7 @@ static void
hd_status_area_dispose (GObject *object)
{
HDStatusArea *status_area = HD_STATUS_AREA (object);
HDStatusAreaPrivate *priv = status_area->priv;
HDStatusAreaPrivate *priv = HD_STATUS_AREA_PRIVATE (status_area);

if (priv->plugin_manager)
priv->plugin_manager = (g_object_unref (priv->plugin_manager), NULL);
Expand All @@ -290,7 +289,7 @@ hd_status_area_dispose (GObject *object)
static void
hd_status_area_finalize (GObject *object)
{
HDStatusAreaPrivate *priv = HD_STATUS_AREA (object)->priv;
HDStatusAreaPrivate *priv = HD_STATUS_AREA_PRIVATE (object);

if (priv->special_item_image)
priv->special_item_image = (g_free (priv->special_item_image), NULL);
Expand All @@ -299,10 +298,14 @@ hd_status_area_finalize (GObject *object)
}

static void
status_area_icon_changed (HDStatusPluginItem *plugin)
status_area_icon_changed (HDStatusPluginItem *plugin,
const GParamSpec *pspec,
HDStatusArea *status_area)
{
HDStatusAreaPrivate *priv = HD_STATUS_AREA_PRIVATE (status_area);
GtkWidget *image;
GdkPixbuf *pixbuf;
int i;

/* Get the image connected with the plugin */
image = g_object_get_qdata (G_OBJECT (plugin),
Expand All @@ -312,6 +315,21 @@ status_area_icon_changed (HDStatusPluginItem *plugin)
g_object_get (G_OBJECT (plugin),
"status-area-icon", &pixbuf,
NULL);


for (i = 0; i < HD_STATUS_AREA_NUM_SPECIAL_ITEMS; i++)
{
if (image == priv->special_item_image[i])
{
int width = pixbuf ? gdk_pixbuf_get_width (pixbuf) :
SPECIAL_ICON_WIDTH;

g_return_if_fail(width >= SPECIAL_ICON_WIDTH);

gtk_widget_set_size_request (image, width, SPECIAL_ICON_HEIGHT);
}
}

gtk_image_set_from_pixbuf (GTK_IMAGE (image), pixbuf);

/*
Expand All @@ -324,7 +342,6 @@ status_area_icon_changed (HDStatusPluginItem *plugin)
if (pixbuf)
{
g_object_unref (pixbuf);

gtk_widget_show (image);
}
else
Expand All @@ -336,7 +353,7 @@ hd_status_area_plugin_added_cb (HDPluginManager *plugin_manager,
GObject *plugin,
HDStatusArea *status_area)
{
HDStatusAreaPrivate *priv = status_area->priv;
HDStatusAreaPrivate *priv = HD_STATUS_AREA_PRIVATE (status_area);
gchar *plugin_id;
GtkWidget *image = NULL;
GKeyFile *keyfile;
Expand Down Expand Up @@ -427,8 +444,8 @@ hd_status_area_plugin_added_cb (HDPluginManager *plugin_manager,
g_object_set (plugin, "status-area-visible", priv->status_area_visible, NULL);

g_signal_connect (plugin, "notify::status-area-icon",
G_CALLBACK (status_area_icon_changed), NULL);
status_area_icon_changed (HD_STATUS_PLUGIN_ITEM (plugin));
G_CALLBACK (status_area_icon_changed), status_area);
status_area_icon_changed (HD_STATUS_PLUGIN_ITEM (plugin), NULL, status_area);

g_free (plugin_id);
}
Expand All @@ -446,7 +463,7 @@ hd_status_area_plugin_removed_cb (HDPluginManager *plugin_manager,
GObject *plugin,
HDStatusArea *status_area)
{
HDStatusAreaPrivate *priv = status_area->priv;
HDStatusAreaPrivate *priv = HD_STATUS_AREA_PRIVATE (status_area);

/* Plugin must be a HDStatusMenuItem */
if (!HD_IS_STATUS_PLUGIN_ITEM (plugin))
Expand Down Expand Up @@ -507,7 +524,7 @@ hd_status_area_items_configuration_loaded_cb (HDPluginManager *plugin_manager,
GKeyFile *key_file,
HDStatusArea *status_area)
{
HDStatusAreaPrivate *priv = status_area->priv;
HDStatusAreaPrivate *priv = HD_STATUS_AREA_PRIVATE (status_area);

gtk_container_foreach (GTK_CONTAINER (priv->icon_box), (GtkCallback) update_position, key_file);
}
Expand All @@ -518,7 +535,7 @@ hd_status_area_set_property (GObject *object,
const GValue *value,
GParamSpec *pspec)
{
HDStatusAreaPrivate *priv = HD_STATUS_AREA (object)->priv;
HDStatusAreaPrivate *priv = HD_STATUS_AREA_PRIVATE (object);

switch (prop_id)
{
Expand Down Expand Up @@ -578,7 +595,7 @@ is_portrait_mode (GtkWidget *widget)
static void
update_alignemnt_padding (HDStatusArea *status_area)
{
HDStatusAreaPrivate *priv = status_area->priv;
HDStatusAreaPrivate *priv = HD_STATUS_AREA_PRIVATE (status_area);
gboolean portrait = is_portrait_mode (GTK_WIDGET (status_area));
guint left_right_padding;

Expand Down Expand Up @@ -659,7 +676,7 @@ hd_status_area_unrealize (GtkWidget *widget)
static void
hd_status_area_map (GtkWidget *widget)
{
HDStatusAreaPrivate *priv = HD_STATUS_AREA (widget)->priv;
HDStatusAreaPrivate *priv = HD_STATUS_AREA_PRIVATE (widget);

priv->resize_after_map = TRUE;

Expand All @@ -669,7 +686,7 @@ hd_status_area_map (GtkWidget *widget)
static void
hd_status_area_check_resize (GtkContainer *container)
{
HDStatusAreaPrivate *priv = HD_STATUS_AREA (container)->priv;
HDStatusAreaPrivate *priv = HD_STATUS_AREA_PRIVATE (container);
GtkWindow *window = GTK_WINDOW (container);
GtkWidget *widget = GTK_WIDGET (container);

Expand Down
2 changes: 0 additions & 2 deletions src/hd-status-area.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ typedef struct _HDStatusAreaPrivate HDStatusAreaPrivate;
struct _HDStatusArea
{
GtkWindow parent_instance;

HDStatusAreaPrivate *priv;
};

struct _HDStatusAreaClass
Expand Down