diff --git a/Makefile.am b/Makefile.am index 5270e0d9..9a6151c4 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,6 +1,6 @@ AUTOMAKE_OPTIONS = gnu -SUBDIRS = katze midori po data +SUBDIRS = katze midori po icons desktopdir = $(datadir)/applications desktop_in_files = midori.desktop diff --git a/configure.in b/configure.in index 097f30ba..b4f78bab 100644 --- a/configure.in +++ b/configure.in @@ -52,7 +52,7 @@ AC_SUBST(GTK_CFLAGS) AC_SUBST(GTK_LIBS) # Checks for gtksourceview -PKG_CHECK_MODULES(GTKSOURCEVIEW, gtksourceview, have_gtksourceview=true, have_gtksourceview=false) +PKG_CHECK_MODULES(GTKSOURCEVIEW, gtksourceview-2.0, have_gtksourceview=true, have_gtksourceview=false) AC_SUBST(GTKSOURCEVIEW_CFLAGS) AC_SUBST(GTKSOURCEVIEW_LIBS) @@ -92,6 +92,6 @@ AC_CONFIG_FILES([ katze/Makefile \ midori/Makefile \ po/Makefile.in \ - data/Makefile + icons/Makefile ]) AC_OUTPUT diff --git a/data/wscript_build b/data/wscript_build deleted file mode 100644 index 83fcaa08..00000000 --- a/data/wscript_build +++ /dev/null @@ -1,38 +0,0 @@ -#! /usr/bin/env python -# WAF build script for midori - -import os -import pproc as subprocess - -srcdir = os.getcwd () -blddir = bld.m_bdir - -install_files ('DATADIR', 'icons/hicolor/scalable/apps', 'midori.svg') - -if bld.env ()['CONVERT']: - def mkdir (path): - if not os.access (path, os.F_OK): - os.mkdir (path) - - mkdir (blddir + '/icons') - - for size in [16, 24, 32, 48]: - format = str (size) + 'x' + str (size) - if size < 32: - small = str ((size / 3)) + 'x' + str ((size / 3.5)) - else: - small = '0x0' - - mkdir (blddir + '/icons/' + format) - convert = subprocess.Popen (['convert', '-adaptive-sharpen', small, - '-background', 'transparent', - '-geometry', format, '-extent', format, - srcdir + '/data/midori.svg', - blddir + '/icons/' + format + '/midori.png'], - stderr=subprocess.PIPE) - if not convert.wait (): - install_files ('DATADIR', 'icons/hicolor/' + format + '/apps', - blddir + '/icons/' + format + '/midori.png') - else: - Params.pprint ('BLUE', "Optimized icons could not be created.") - break diff --git a/icons/16x16/midori.png b/icons/16x16/midori.png new file mode 100644 index 00000000..578f6cb5 Binary files /dev/null and b/icons/16x16/midori.png differ diff --git a/icons/16x16/news-feed.png b/icons/16x16/news-feed.png new file mode 100644 index 00000000..05363c5a Binary files /dev/null and b/icons/16x16/news-feed.png differ diff --git a/icons/22x22/midori.png b/icons/22x22/midori.png new file mode 100644 index 00000000..85523e8f Binary files /dev/null and b/icons/22x22/midori.png differ diff --git a/icons/22x22/news-feed.png b/icons/22x22/news-feed.png new file mode 100644 index 00000000..3cf9465b Binary files /dev/null and b/icons/22x22/news-feed.png differ diff --git a/data/Makefile.am b/icons/Makefile.am similarity index 93% rename from data/Makefile.am rename to icons/Makefile.am index 6341bfc8..b03110ca 100644 --- a/data/Makefile.am +++ b/icons/Makefile.am @@ -1,5 +1,5 @@ iconsdir = $(datadir)/icons/hicolor/scalable/apps -icons_DATA = midori.svg +icons_DATA = scalable/midori.svg EXTRA_DIST = $(icons_DATA) diff --git a/data/midori.svg b/icons/scalable/midori.svg similarity index 100% rename from data/midori.svg rename to icons/scalable/midori.svg diff --git a/icons/scalable/news-feed.svg b/icons/scalable/news-feed.svg new file mode 100644 index 00000000..2a2f6238 --- /dev/null +++ b/icons/scalable/news-feed.svg @@ -0,0 +1,280 @@ + + +image/svg+xml \ No newline at end of file diff --git a/icons/wscript_build b/icons/wscript_build new file mode 100644 index 00000000..bbf8ad64 --- /dev/null +++ b/icons/wscript_build @@ -0,0 +1,47 @@ +#! /usr/bin/env python +# WAF build script for midori + +def add_image (bld, install_files, category, name): + import os + import pproc as subprocess + + srcdir = os.getcwd () + blddir = bld.m_bdir + + def mkdir (path): + if not os.access (path, os.F_OK): + os.mkdir (path) + + def _install_files (folder, destination, source): + try: + install_files (folder, destination, source) + except: + pass + + if bld.env ()['CONVERT']: + mkdir (blddir + '/icons') + + for size in [16, 22, 32, 48]: + format = str (size) + 'x' + str (size) + if os.access (srcdir + '/icons/' + format + '/' + name + '.png', os.F_OK): + _install_files ('DATADIR', 'icons/hicolor/' + format + '/' + category, + srcdir + '/icons/' + format + '/' + name + '.png') + elif not bld.env ()['CONVERT']: + pass + elif os.access (srcdir + '/icons/scalable/' + name + '.svg', os.F_OK): + mkdir (blddir + '/icons/' + format) + convert = subprocess.Popen (['convert', + '-background', 'transparent', + '-geometry', format, '-extent', format, + srcdir + '/icons/scalable/' + name + '.svg', + blddir + '/icons/' + format + '/' + name + '.png'], + stderr=subprocess.PIPE) + if not convert.wait (): + _install_files ('DATADIR', 'icons/hicolor/' + format + '/' + category, + blddir + '/icons/' + format + '/' + name + '.png') + else: + Params.pprint ('BLUE', "Optimized icons could not be created.") + break + +add_image (bld, install_files, 'apps', 'midori') +add_image (bld, install_files, 'status', 'news-feed') diff --git a/midori/main.c b/midori/main.c index 32f14517..c586d8ee 100644 --- a/midori/main.c +++ b/midori/main.c @@ -35,6 +35,7 @@ stock_items_init (void) { static GtkStockItem items[] = { + { STOCK_NEWS_FEED }, { STOCK_LOCK_OPEN }, { STOCK_LOCK_SECURE }, { STOCK_LOCK_BROKEN }, diff --git a/midori/main.h b/midori/main.h index f9fcf4df..29b1bb53 100644 --- a/midori/main.h +++ b/midori/main.h @@ -31,7 +31,7 @@ KatzeXbelItem* bookmarks; #define STOCK_BOOKMARK GTK_STOCK_FILE /* "stock_bookmark" "bookmark-web" */ #define STOCK_FORM_FILL GTK_STOCK_JUSTIFY_FILL /* "insert-text" "form-fill" */ -#define STOCK_NEWSFEED GTK_STOCK_INDEX +#define STOCK_NEWS_FEED "news-feed" /* We assume that these legacy icon names are usually present */ diff --git a/midori/midori-browser.c b/midori/midori-browser.c index 1d23ec7b..03511b79 100644 --- a/midori/midori-browser.c +++ b/midori/midori-browser.c @@ -71,6 +71,8 @@ struct _MidoriBrowser GtkWidget* statusbar; GtkWidget* progressbar; + const gchar* stock_news_feed; + gchar* statusbar_text; MidoriWebSettings* settings; GList* tab_titles; @@ -475,7 +477,7 @@ midori_web_view_news_feed_ready_cb (MidoriWebView* web_view, { gtk_icon_entry_set_icon_from_stock (GTK_ICON_ENTRY ( gtk_bin_get_child (GTK_BIN (browser->location))), - GTK_ICON_ENTRY_SECONDARY, GTK_STOCK_INDEX); + GTK_ICON_ENTRY_SECONDARY, browser->stock_news_feed); } static gboolean @@ -3035,16 +3037,24 @@ static const gchar* ui_markup = ""; static void -midori_browser_realize_cb (GtkStyle* style, MidoriBrowser* browser) +midori_browser_realize_cb (GtkStyle* style, + MidoriBrowser* browser) { - GdkScreen* screen = gtk_widget_get_screen (GTK_WIDGET (browser)); + GdkScreen* screen; + GtkIconTheme* icon_theme; + + screen = gtk_widget_get_screen (GTK_WIDGET (browser)); if (screen) { - GtkIconTheme* icon_theme = gtk_icon_theme_get_for_screen (screen); + icon_theme = gtk_icon_theme_get_for_screen (screen); if (gtk_icon_theme_has_icon (icon_theme, "midori")) gtk_window_set_icon_name (GTK_WINDOW (browser), "midori"); else gtk_window_set_icon_name (GTK_WINDOW (browser), "web-browser"); + if (gtk_icon_theme_has_icon (icon_theme, STOCK_NEWS_FEED)) + browser->stock_news_feed = STOCK_NEWS_FEED; + else + browser->stock_news_feed = GTK_STOCK_INDEX; } } @@ -3120,6 +3130,8 @@ midori_browser_init (MidoriBrowser* browser) { GtkRcStyle* rcstyle; + browser->stock_news_feed = GTK_STOCK_INDEX; + /* Setup the window metrics */ g_signal_connect (browser, "realize", G_CALLBACK (midori_browser_realize_cb), browser); @@ -3233,7 +3245,7 @@ midori_browser_init (MidoriBrowser* browser) /* FIXME: Due to a bug in GtkIconEntry we need to set an initial icon */ gtk_icon_entry_set_icon_from_stock (GTK_ICON_ENTRY ( gtk_bin_get_child (GTK_BIN (browser->location))), - GTK_ICON_ENTRY_SECONDARY, GTK_STOCK_INDEX); + GTK_ICON_ENTRY_SECONDARY, browser->stock_news_feed); gtk_icon_entry_set_icon_highlight (GTK_ICON_ENTRY ( gtk_bin_get_child (GTK_BIN (browser->location))), GTK_ICON_ENTRY_SECONDARY, TRUE); diff --git a/wscript b/wscript index c42e0dca..cfef9ce5 100644 --- a/wscript +++ b/wscript @@ -65,7 +65,7 @@ def set_options (opt): help='Disables native language support', dest='disable_nls') def build (bld): - bld.add_subdirs ('katze midori data') + bld.add_subdirs ('katze midori icons') if bld.env ()['INTLTOOL']: bld.add_subdirs ('po') @@ -89,9 +89,11 @@ def shutdown (): if not Params.g_options.destdir: # update the pixmap cache directory try: - subprocess.call (['gtk-update-icon-cache', '-q', '-f', '-t', dir]) - Params.pprint ('YELLOW', "Updated Gtk icon cache.") - icon_cache_updated = True + uic = subprocess.Popen (['gtk-update-icon-cache', '-q', '-f', '-t', dir], + stderr=subprocess.PIPE) + if not uic.wait (): + Params.pprint ('YELLOW', "Updated Gtk icon cache.") + icon_cache_updated = True except: Params.pprint ('RED', "Failed to update icon cache.") if not icon_cache_updated: