[network-manager-netbook/MplPanelClient: 7/7] Some more fixes for MplPanelClient conversion.
- From: Tambet Ingo <tambeti src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [network-manager-netbook/MplPanelClient: 7/7] Some more fixes for MplPanelClient conversion.
- Date: Wed, 9 Sep 2009 13:13:45 +0000 (UTC)
commit d901103a54b575c73290a5896643ba530d12962c
Author: Tambet Ingo <tambet gmail com>
Date: Wed Sep 9 15:27:07 2009 +0300
Some more fixes for MplPanelClient conversion.
src/main.c | 2 +-
src/nmn-applet.c | 29 +++++++++++++++--------------
2 files changed, 16 insertions(+), 15 deletions(-)
---
diff --git a/src/main.c b/src/main.c
index b760f6e..58e7aa3 100644
--- a/src/main.c
+++ b/src/main.c
@@ -53,7 +53,7 @@ main (int argc, char *argv[])
TRUE);
applet = nmn_applet_new (panel_client);
- mpl_panel_client_set_height_request (panel_client, 500);
+ mpl_panel_client_set_height_request (panel_client, 499);
utils_set_main_widget (G_OBJECT (panel_client));
diff --git a/src/nmn-applet.c b/src/nmn-applet.c
index 8042d79..2ec4722 100644
--- a/src/nmn-applet.c
+++ b/src/nmn-applet.c
@@ -40,7 +40,6 @@ enum {
typedef struct {
NmnNMData *nm_data;
MplPanelClient *panel_client;
- GtkContainer *main_window;
NmnStatusIcon *status_icon;
GtkBuilder *builder;
@@ -56,7 +55,6 @@ typedef struct {
GtkWidget *new_dialog;
gboolean network_list_populated;
- int pop_counter;
gboolean disposed;
} NmnAppletPrivate;
@@ -272,8 +270,6 @@ add_new_connection_show (GtkButton *button,
NmnAppletPrivate *priv = GET_PRIVATE (user_data);
gtk_widget_hide (priv->pane);
- gtk_container_remove (priv->main_window, priv->pane);
- gtk_container_add (priv->main_window, priv->new_dialog);
gtk_widget_show (priv->new_dialog);
}
@@ -284,8 +280,6 @@ add_new_connection_hide (GtkWidget *widget,
NmnAppletPrivate *priv = GET_PRIVATE (user_data);
gtk_widget_hide (priv->new_dialog);
- gtk_container_remove (priv->main_window, priv->new_dialog);
- gtk_container_add (priv->main_window, priv->pane);
gtk_widget_show (priv->pane);
}
@@ -319,10 +313,7 @@ static void
hide_end_cb (MplPanelClient *panel_client,
gpointer user_data)
{
- NmnAppletPrivate *priv = GET_PRIVATE (user_data);
-
- if (gtk_bin_get_child (GTK_BIN (priv->main_window)) == priv->new_dialog)
- add_new_connection_hide (NULL, user_data);
+ add_new_connection_hide (NULL, user_data);
}
static DBusGConnection *
@@ -428,6 +419,8 @@ constructor (GType type,
{
GObject *object;
NmnAppletPrivate *priv;
+ GtkWidget *box;
+ GtkWidget *window;
object = G_OBJECT_CLASS (nmn_applet_parent_class)->constructor
(type, n_construct_params, construct_params);
@@ -443,14 +436,22 @@ constructor (GType type,
return NULL;
}
- priv->main_window = GTK_CONTAINER (mpl_panel_gtk_get_window (MPL_PANEL_GTK (priv->panel_client)));
- gtk_container_add (priv->main_window, priv->pane);
+ box = gtk_vbox_new (FALSE, 0);
+ gtk_widget_show (priv->pane);
+ gtk_box_pack_start (GTK_BOX (box), priv->pane, TRUE, TRUE, 0);
+
+ gtk_widget_hide (priv->new_dialog);
+ gtk_box_pack_end (GTK_BOX (box), priv->new_dialog, TRUE, TRUE, 0);
+
+ gtk_widget_show (box);
+ window = mpl_panel_gtk_get_window (MPL_PANEL_GTK (priv->panel_client));
+ gtk_container_add (GTK_CONTAINER (window), box);
+ gtk_widget_modify_bg (window, GTK_STATE_NORMAL, >k_widget_get_style (window)->white);
+ gtk_widget_show (GTK_WIDGET (window));
g_signal_connect (priv->panel_client, "show-begin", G_CALLBACK (show_begin_cb), object);
g_signal_connect (priv->panel_client, "hide-end", G_CALLBACK (hide_end_cb), object);
- gtk_widget_show (GTK_WIDGET (priv->main_window));
-
return object;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]