Default panel placement to the primary monitor (when available)
This commit is contained in:
parent
f3aacd2b47
commit
5b29b91c7a
28
po/fr.po
28
po/fr.po
|
@ -7,7 +7,7 @@ msgid ""
|
|||
msgstr ""
|
||||
"Project-Id-Version: Panel 0.0.5\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2011-07-18 02:06+0200\n"
|
||||
"POT-Creation-Date: 2011-08-05 21:50+0200\n"
|
||||
"PO-Revision-Date: 2010-04-22 12:45+0200\n"
|
||||
"Last-Translator: Pierre Pronchery <khorben@defora.org>\n"
|
||||
"Language-Team: French\n"
|
||||
|
@ -21,7 +21,7 @@ msgstr ""
|
|||
msgid "Unknown"
|
||||
msgstr "Inconnu"
|
||||
|
||||
#: ../src/applets/battery.c:186 ../src/panel.c:419 ../src/panel.c:424
|
||||
#: ../src/applets/battery.c:186 ../src/panel.c:425 ../src/panel.c:430
|
||||
#: ../src/run.c:214 ../src/run.c:220
|
||||
msgid "Error"
|
||||
msgstr "Erreur"
|
||||
|
@ -88,8 +88,8 @@ msgstr "Verrouiller l'écran"
|
|||
msgid "Logging out is disabled"
|
||||
msgstr "Se déconnecter est désactivé"
|
||||
|
||||
#: ../src/applets/logout.c:70 ../src/panel.c:846 ../src/panel.c:853
|
||||
#: ../src/panel.c:862
|
||||
#: ../src/applets/logout.c:70 ../src/panel.c:852 ../src/panel.c:859
|
||||
#: ../src/panel.c:868
|
||||
msgid "Logout"
|
||||
msgstr "Déconnexion"
|
||||
|
||||
|
@ -190,27 +190,27 @@ msgstr "Petite"
|
|||
msgid "Smaller"
|
||||
msgstr "Très petite"
|
||||
|
||||
#: ../src/panel.c:525
|
||||
#: ../src/panel.c:531
|
||||
msgid "Panel preferences"
|
||||
msgstr "Préférences du Panel"
|
||||
|
||||
#: ../src/panel.c:541
|
||||
#: ../src/panel.c:547
|
||||
msgid "Top size:"
|
||||
msgstr "Taille du haut :"
|
||||
|
||||
#: ../src/panel.c:565
|
||||
#: ../src/panel.c:571
|
||||
msgid "Bottom size:"
|
||||
msgstr "Taille du bas :"
|
||||
|
||||
#: ../src/panel.c:590
|
||||
#: ../src/panel.c:596
|
||||
msgid "General"
|
||||
msgstr "Général"
|
||||
|
||||
#: ../src/panel.c:789
|
||||
#: ../src/panel.c:795
|
||||
msgid "translator-credits"
|
||||
msgstr "Pierre Pronchery <khorben@defora.org>"
|
||||
|
||||
#: ../src/panel.c:832
|
||||
#: ../src/panel.c:838
|
||||
msgid ""
|
||||
"This will log you out of the current session, therefore closing any "
|
||||
"application currently opened and losing any unsaved data.\n"
|
||||
|
@ -221,7 +221,7 @@ msgstr ""
|
|||
"sauvegardées.\n"
|
||||
"Voulez-vous continuer?"
|
||||
|
||||
#: ../src/panel.c:948
|
||||
#: ../src/panel.c:954
|
||||
msgid ""
|
||||
"This will shutdown your device, therefore closing any application currently "
|
||||
"opened and losing any unsaved data.\n"
|
||||
|
@ -232,7 +232,7 @@ msgstr ""
|
|||
"sauvegardées.\n"
|
||||
"Voulez-vous continuer?"
|
||||
|
||||
#: ../src/panel.c:953
|
||||
#: ../src/panel.c:959
|
||||
msgid ""
|
||||
"This will shutdown your computer, therefore closing any application "
|
||||
"currently opened and losing any unsaved data.\n"
|
||||
|
@ -243,11 +243,11 @@ msgstr ""
|
|||
"sauvegardées.\n"
|
||||
"Voulez-vous continuer?"
|
||||
|
||||
#: ../src/panel.c:967 ../src/panel.c:974 ../src/panel.c:983
|
||||
#: ../src/panel.c:973 ../src/panel.c:980 ../src/panel.c:989
|
||||
msgid "Shutdown"
|
||||
msgstr "Arrêter"
|
||||
|
||||
#: ../src/panel.c:973
|
||||
#: ../src/panel.c:979
|
||||
msgid "Restart"
|
||||
msgstr "Redémarrer"
|
||||
|
||||
|
|
|
@ -64,8 +64,8 @@ int main(int argc, char * argv[])
|
|||
bindtextdomain(PACKAGE, LOCALEDIR);
|
||||
textdomain(PACKAGE);
|
||||
gtk_init(&argc, &argv);
|
||||
memset(&prefs, 0, sizeof(prefs));
|
||||
prefs.iconsize = PANEL_ICON_SIZE_UNSET;
|
||||
prefs.monitor = -1;
|
||||
while((o = getopt(argc, argv, "lm:sx")) != -1)
|
||||
switch(o)
|
||||
{
|
||||
|
|
22
src/panel.c
22
src/panel.c
|
@ -136,7 +136,8 @@ static char * _config_get_filename(void);
|
|||
/* public */
|
||||
/* panel_new */
|
||||
static int _new_config(Panel * panel);
|
||||
static void _new_prefs(PanelPrefs * prefs, PanelPrefs const * user);
|
||||
static void _new_prefs(GdkScreen * screen, PanelPrefs * prefs,
|
||||
PanelPrefs const * user);
|
||||
static GtkIconSize _new_size(Panel * panel, PanelPosition position);
|
||||
static gboolean _on_idle(gpointer data);
|
||||
static void _idle_load(Panel * panel, PanelPosition position,
|
||||
|
@ -154,7 +155,8 @@ Panel * panel_new(PanelPrefs const * prefs)
|
|||
if((panel = object_new(sizeof(*panel))) == NULL)
|
||||
return NULL;
|
||||
_new_config(panel);
|
||||
_new_prefs(&panel->prefs, prefs);
|
||||
screen = gdk_screen_get_default();
|
||||
_new_prefs(screen, &panel->prefs, prefs);
|
||||
prefs = &panel->prefs;
|
||||
panel->top_helper.panel = panel;
|
||||
panel->top_helper.config_get = _panel_helper_config_get;
|
||||
|
@ -206,7 +208,6 @@ Panel * panel_new(PanelPrefs const * prefs)
|
|||
return NULL;
|
||||
}
|
||||
/* root window */
|
||||
screen = gdk_screen_get_default();
|
||||
panel->root = gdk_screen_get_root_window(screen);
|
||||
gdk_screen_get_monitor_geometry(screen, (prefs->monitor > 0
|
||||
&& prefs->monitor < gdk_screen_get_n_monitors(
|
||||
|
@ -241,7 +242,8 @@ static int _new_config(Panel * panel)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static void _new_prefs(PanelPrefs * prefs, PanelPrefs const * user)
|
||||
static void _new_prefs(GdkScreen * screen, PanelPrefs * prefs,
|
||||
PanelPrefs const * user)
|
||||
{
|
||||
size_t i;
|
||||
gint width;
|
||||
|
@ -258,12 +260,16 @@ static void _new_prefs(PanelPrefs * prefs, PanelPrefs const * user)
|
|||
gtk_icon_size_register(_panel_sizes[i].name, width, height);
|
||||
}
|
||||
if(user != NULL)
|
||||
{
|
||||
memcpy(prefs, user, sizeof(*prefs));
|
||||
return;
|
||||
else
|
||||
{
|
||||
prefs->iconsize = PANEL_ICON_SIZE_DEFAULT;
|
||||
prefs->monitor = -1;
|
||||
}
|
||||
prefs->iconsize = PANEL_ICON_SIZE_DEFAULT;
|
||||
prefs->monitor = -1;
|
||||
#if GTK_CHECK_VERSION(2, 20, 0)
|
||||
if(prefs->monitor == -1)
|
||||
prefs->monitor = gdk_screen_get_primary_monitor(screen);
|
||||
#endif
|
||||
}
|
||||
|
||||
static GtkIconSize _new_size(Panel * panel, PanelPosition position)
|
||||
|
|
Loading…
Reference in New Issue
Block a user