Improve OSX adjustments in various places

This commit is contained in:
Christian Dywan 2008-10-26 00:54:57 +02:00
parent 1f915eb58a
commit b931e1bf53
10 changed files with 72 additions and 30 deletions

View file

@ -92,7 +92,6 @@ if test "x$MSGFMT" = "xno"; then
AC_MSG_ERROR([msgfmt not found. Please install the gettext package.])
fi
# Here we tell the configure script which files to *create*
AC_CONFIG_FILES([
Makefile \

View file

@ -2,15 +2,17 @@
INCLUDES = \
$(UNIQUE_CFLAGS) \
$(LIBXML_CFLAGS) \
$(SQLITE3_CFLAGS) \
$(GTK_CFLAGS) \
$(WEBKIT_CFLAGS) \
-I../katze
AM_CFLAGS = -DMIDORI_LOCALEDIR=\""$(localedir)"\"
AM_CFLAGS = -DLOCALEDIR=\""$(localedir)"\" -DDATADIR=\""$(datadir)"\"
LDADD = \
$(UNIQUE_LIBS) \
$(LIBXML_LIBS) \
$(SQLITE3_LIBS) \
$(GTK_LIBS) \
$(WEBKIT_LIBS) \

View file

@ -1084,7 +1084,7 @@ main (int argc,
#endif
#if ENABLE_NLS
bindtextdomain (GETTEXT_PACKAGE, MIDORI_LOCALEDIR);
bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
textdomain (GETTEXT_PACKAGE);
#endif

View file

@ -864,6 +864,9 @@ midori_cclosure_marshal_VOID__OBJECT_POINTER_POINTER (GClosure* closure,
static void
midori_browser_class_init (MidoriBrowserClass* class)
{
GObjectClass* gobject_class;
GParamFlags flags;
signals[WINDOW_OBJECT_CLEARED] = g_signal_new (
"window-object-cleared",
G_TYPE_FROM_CLASS (class),
@ -936,13 +939,13 @@ midori_browser_class_init (MidoriBrowserClass* class)
class->activate_action = _midori_browser_activate_action;
class->quit = _midori_browser_quit;
GObjectClass* gobject_class = G_OBJECT_CLASS (class);
gobject_class = G_OBJECT_CLASS (class);
gobject_class->dispose = midori_browser_dispose;
gobject_class->finalize = midori_browser_finalize;
gobject_class->set_property = midori_browser_set_property;
gobject_class->get_property = midori_browser_get_property;
GParamFlags flags = G_PARAM_READWRITE | G_PARAM_CONSTRUCT;
flags = G_PARAM_READWRITE | G_PARAM_CONSTRUCT;
g_object_class_install_property (gobject_class,
PROP_MENUBAR,
@ -2583,7 +2586,7 @@ _action_tab_next_activate (GtkAction* action,
static const gchar* credits_authors[] = {
"Christian Dywan <christian@twotoasts.de>", NULL };
static const gchar* credits_documenters[] = {
"Christian Dywan <christian@twotoasts.de>" };
"Christian Dywan <christian@twotoasts.de>", NULL };
static const gchar* credits_artists[] = {
"Nancy Runge <nancy@twotoasts.de>", NULL };
@ -2672,7 +2675,6 @@ _action_help_link_activate (GtkAction* action,
}
static void
_action_panel_activate (GtkToggleAction* action,
MidoriBrowser* browser)
@ -2701,7 +2703,6 @@ _action_open_in_panel_activate (GtkAction* action,
midori_view_set_uri (MIDORI_VIEW (browser->panel_pageholder), uri);
}
static void
midori_panel_notify_position_cb (GObject* object,
GParamSpec* arg1,
@ -3824,7 +3825,11 @@ midori_browser_init (MidoriBrowser* browser)
gtk_tool_button_set_label (GTK_TOOL_BUTTON (toolitem), _("Close Findbar"));
g_signal_connect (toolitem, "clicked",
G_CALLBACK (midori_browser_find_button_close_clicked_cb), browser);
#ifdef HAVE_OSX
gtk_toolbar_insert (GTK_TOOLBAR (browser->find), toolitem, 0);
#else
gtk_toolbar_insert (GTK_TOOLBAR (browser->find), toolitem, -1);
#endif
sokoke_container_show_children (GTK_CONTAINER (browser->find));
gtk_box_pack_start (GTK_BOX (vbox), browser->find, FALSE, FALSE, 0);

View file

@ -208,7 +208,11 @@ midori_panel_init (MidoriPanel* panel)
gtk_tool_item_set_tooltip_text (GTK_TOOL_ITEM (toolitem), _("Close panel"));
g_signal_connect (toolitem, "clicked",
G_CALLBACK (midori_panel_button_close_clicked_cb), panel);
#if HAVE_OSX
gtk_toolbar_insert (GTK_TOOLBAR (labelbar), toolitem, 0);
#else
gtk_toolbar_insert (GTK_TOOLBAR (labelbar), toolitem, -1);
#endif
gtk_box_pack_start (GTK_BOX (vbox), labelbar, FALSE, FALSE, 0);
gtk_widget_show_all (vbox);

View file

@ -11,6 +11,10 @@
#include "midori-preferences.h"
#if HAVE_CONFIG_H
#include <config.h>
#endif
#include "sokoke.h"
#include <glib/gi18n.h>
@ -72,10 +76,6 @@ midori_preferences_response_cb (MidoriPreferences* preferences,
gtk_widget_destroy (GTK_WIDGET (preferences));
}
#ifdef GDK_WINDOWING_QUARTZ
#define USE_OSX_STYLE
#endif
static void
midori_preferences_init (MidoriPreferences* preferences)
{
@ -90,7 +90,7 @@ midori_preferences_init (MidoriPreferences* preferences)
"title", dialog_title,
"has-separator", FALSE,
NULL);
#ifndef USE_OSX_STYLE
#ifndef HAVE_OSX
gtk_dialog_add_buttons (GTK_DIALOG (preferences),
GTK_STOCK_HELP, GTK_RESPONSE_HELP,
GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE,
@ -213,7 +213,7 @@ proxy_download_manager_icon_cb (GtkWidget* entry,
return FALSE;
}
#ifdef USE_OSX_STYLE
#ifdef HAVE_OSX
static void
midori_preferences_help_clicked_cb (GtkWidget* button,
GtkDialog* dialog)
@ -238,7 +238,7 @@ midori_preferences_add_toolbutton (GtkWidget* toolbar,
const gchar* label,
GtkWidget* page)
{
#ifdef USE_OSX_STYLE
#ifdef HAVE_OSX
*toolbutton = GTK_WIDGET (*toolbutton ? gtk_radio_tool_button_new_from_widget (
GTK_RADIO_TOOL_BUTTON (*toolbutton)) : gtk_radio_tool_button_new (NULL));
gtk_tool_button_set_label (GTK_TOOL_BUTTON (*toolbutton), label);
@ -282,7 +282,7 @@ midori_preferences_set_settings (MidoriPreferences* preferences,
preferences->notebook = gtk_notebook_new ();
gtk_container_set_border_width (GTK_CONTAINER (preferences->notebook), 6);
#ifdef USE_OSX_STYLE
#ifdef HAVE_OSX
gtk_notebook_set_show_tabs (GTK_NOTEBOOK (preferences->notebook), FALSE);
gtk_notebook_set_show_border (GTK_NOTEBOOK (preferences->notebook), FALSE);
toolbar = gtk_toolbar_new ();
@ -290,8 +290,9 @@ midori_preferences_set_settings (MidoriPreferences* preferences,
gtk_toolbar_set_show_arrow (GTK_TOOLBAR (toolbar), FALSE);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (preferences)->vbox),
toolbar, FALSE, FALSE, 0);
#endif
#else
toolbar = NULL;
#endif
toolbutton = NULL;
sizegroup = NULL;
@ -515,7 +516,7 @@ midori_preferences_set_settings (MidoriPreferences* preferences,
g_object_unref (sizegroup);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (preferences)->vbox),
preferences->notebook, FALSE, FALSE, 4);
#ifdef USE_OSX_STYLE
#ifdef HAVE_OSX
GtkWidget* icon;
hbox = gtk_hbox_new (FALSE, 0);
button = gtk_button_new ();

View file

@ -1069,8 +1069,10 @@ midori_search_action_get_dialog (MidoriSearchAction* search_action)
dialog = gtk_dialog_new_with_buttons (dialog_title,
toplevel ? GTK_WINDOW (toplevel) : NULL,
GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_NO_SEPARATOR,
#ifndef HAVE_OSX
GTK_STOCK_HELP, GTK_RESPONSE_HELP,
GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE,
#endif
NULL);
g_signal_connect (dialog, "destroy",
G_CALLBACK (gtk_widget_destroyed), &search_action->dialog);
@ -1155,6 +1157,22 @@ midori_search_action_get_dialog (MidoriSearchAction* search_action)
button = gtk_button_new_from_stock (GTK_STOCK_GO_UP);
gtk_widget_set_sensitive (button, FALSE);
gtk_box_pack_end (GTK_BOX (vbox), button, FALSE, FALSE, 0);
#ifdef HAVE_OSX
GtkWidget* icon;
hbox = gtk_hbox_new (FALSE, 0);
button = gtk_button_new ();
icon = gtk_image_new_from_stock (GTK_STOCK_HELP, GTK_ICON_SIZE_BUTTON);
gtk_button_set_image (GTK_BUTTON (button), icon);
/* TODO: Implement some kind of help function */
gtk_widget_set_sensitive (button, FALSE);
/* g_signal_connect (button, "clicked",
G_CALLBACK (midori_search_action_dialog_help_clicked_cb), dialog); */
gtk_box_pack_end (GTK_BOX (hbox),
button, FALSE, FALSE, 4);
gtk_box_pack_end (GTK_BOX (GTK_DIALOG (dialog)->vbox),
hbox, FALSE, FALSE, 0);
#endif
gtk_widget_show_all (GTK_DIALOG (dialog)->vbox);
g_object_connect (search_action->search_engines,

View file

@ -1648,10 +1648,8 @@ midori_view_get_proxy_tab_label (MidoriView* view)
gtk_container_border_width (GTK_CONTAINER (hbox), 2);
gtk_container_add (GTK_CONTAINER (event_box), GTK_WIDGET (hbox));
gtk_misc_set_alignment (GTK_MISC (view->tab_icon), 0.0, 0.5);
gtk_box_pack_start (GTK_BOX (hbox), view->tab_icon, FALSE, FALSE, 0);
gtk_misc_set_alignment (GTK_MISC (view->tab_title), 0.0, 0.5);
/* TODO: make the tab initially look "unvisited" until it's focused */
gtk_box_pack_start (GTK_BOX (hbox), view->tab_title, FALSE, TRUE, 0);
_update_label_size (view->tab_title, 10);
view->tab_close = gtk_button_new ();
@ -1666,7 +1664,16 @@ midori_view_get_proxy_tab_label (MidoriView* view)
GTK_STOCK_CLOSE);
gtk_button_set_image (GTK_BUTTON (view->tab_close), image);
gtk_misc_set_alignment (GTK_MISC (image), 0.0, 0.0);
#if HAVE_OSX
gtk_box_pack_end (GTK_BOX (hbox), view->tab_icon, FALSE, FALSE, 0);
gtk_box_pack_end (GTK_BOX (hbox), view->tab_title, FALSE, TRUE, 0);
gtk_box_pack_end (GTK_BOX (hbox), view->tab_close, FALSE, FALSE, 0);
#else
gtk_box_pack_start (GTK_BOX (hbox), view->tab_icon, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (hbox), view->tab_title, FALSE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (hbox), view->tab_close, FALSE, FALSE, 0);
#endif
gtk_widget_show_all (GTK_WIDGET (event_box));
if (!view->close_buttons_on_tabs)

View file

@ -9,12 +9,12 @@
See the file COPYING for the full license text.
*/
#include "sokoke.h"
#if HAVE_CONFIG_H
#include <config.h>
#endif
#include "sokoke.h"
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
@ -48,6 +48,9 @@ sokoke_spawn_program (const gchar* command,
gchar** argv;
GError* error;
g_return_val_if_fail (command != NULL, FALSE);
g_return_val_if_fail (argument != NULL, FALSE);
argument_escaped = g_shell_quote (argument);
if (strstr (command, "%s"))
command_ready = g_strdup_printf (command, argument_escaped);
@ -205,13 +208,16 @@ typedef enum
{
SOKOKE_DESKTOP_UNTESTED,
SOKOKE_DESKTOP_XFCE,
SOKOKE_DESKTOP_OSX,
SOKOKE_DESKTOP_UNKNOWN
} SokokeDesktop;
static SokokeDesktop
sokoke_get_desktop (void)
{
#ifdef GDK_WINDOWING_X11
#ifdef HAVE_OSX
return SOKOKE_DESKTOP_OSX;
#else
static SokokeDesktop desktop = SOKOKE_DESKTOP_UNTESTED;
if (G_UNLIKELY (desktop == SOKOKE_DESKTOP_UNTESTED))
{
@ -227,8 +233,6 @@ sokoke_get_desktop (void)
}
return desktop;
#else
return SOKOKE_DESKTOP_UNKNOWN;
#endif
}

12
wscript
View file

@ -5,7 +5,7 @@
import Params
import pproc as subprocess
import Common
import platform
import sys
import os
APPNAME = 'midori'
@ -117,6 +117,8 @@ def configure (conf):
conf.check_pkg ('libxml-2.0', destvar='LIBXML', vnum='2.6', mandatory=True)
conf.check_header ('unistd.h', 'HAVE_UNISTD_H')
if sys.platform == 'darwin':
conf.define ('HAVE_OSX', 1)
if conf.find_program ('rsvg-convert', var='RSVG_CONVERT'):
icons = 'yes'
@ -168,7 +170,7 @@ def build (bld):
bld.add_subdirs ('katze midori icons')
install_files ('DOCDIR', '/midori/', 'AUTHORS ChangeLog COPYING EXPAT README')
install_files ('DOCDIR', '/' + APPNAME + '/', 'AUTHORS ChangeLog COPYING EXPAT README')
if bld.env ()['RST2HTML']:
# FIXME: Build only if needed
@ -194,15 +196,15 @@ def build (bld):
if bld.env ()['INTLTOOL']:
obj = bld.create_obj ('intltool_in')
obj.source = 'midori.desktop.in'
obj.source = APPNAME + '.desktop.in'
obj.inst_var = 'DATADIR'
obj.inst_dir = 'applications'
obj.flags = '-d'
else:
# FIXME: process desktop.in without intltool
Params.pprint ('BLUE', "File midori.desktop not generated")
Params.pprint ('BLUE', "File " + APPNAME + ".desktop not generated")
if bld.env ()['INTLTOOL']:
install_files ('DATADIR', 'applications', 'midori.desktop')
install_files ('DATADIR', 'applications', APPNAME + '.desktop')
if bld.env ()['RSVG_CONVERT']:
mkdir (blddir + '/data')