Commit 896f115b authored by daniel_e's avatar daniel_e
Browse files

(regexxer_register_stock_items): Always set the intended icon size, but disable

wildcarding for all but the last pixbuf in an icon set.
parent f397484b
2002-11-18 Daniel Elstner <daniel.elstner@gmx.net>
* src/main.cc (regexxer_register_stock_items): Always set the
intended icon size, but disable wildcarding for all but the last
pixbuf in an icon set.
2002-11-17 Daniel Elstner <daniel.elstner@gmx.net>
* pixmaps/stock_save_all_16.png: New menu icon.
......
......@@ -35,8 +35,11 @@
namespace
{
/* Include inlined raw pixbuf data generated by gdk-pixbuf-csource.
*/
#include <pixmaps/stockimages.h>
struct StockIconData
{
const guint8* data;
......@@ -52,15 +55,16 @@ struct StockItemData
const char* label;
};
const StockIconData stock_icon_info[] =
{
{ stock_menu_about, sizeof(stock_menu_about), Gtk::ICON_SIZE_INVALID }
{ stock_menu_about, sizeof(stock_menu_about), Gtk::ICON_SIZE_SMALL_TOOLBAR }
};
const StockIconData stock_icon_save_all[] =
{
{ stock_save_all_16, sizeof(stock_save_all_16), Gtk::ICON_SIZE_MENU },
{ stock_save_all_24, sizeof(stock_save_all_24), Gtk::ICON_SIZE_INVALID }
{ stock_save_all_16, sizeof(stock_save_all_16), Gtk::ICON_SIZE_MENU },
{ stock_save_all_24, sizeof(stock_save_all_24), Gtk::ICON_SIZE_SMALL_TOOLBAR }
};
const StockItemData regexxer_stock_items[] =
......@@ -82,20 +86,19 @@ void regexxer_register_stock_items()
for(unsigned icon = 0; icon < stock.n_icons; ++icon)
{
const StockIconData& icon_data = stock.icons[icon];
Gtk::IconSource source;
source.set_pixbuf(Gdk::Pixbuf::create_from_inline(icon_data.length, icon_data.data));
source.set_size(icon_data.size);
if(icon_data.size != Gtk::ICON_SIZE_INVALID)
{
source.set_size(icon_data.size);
source.set_size_wildcarded(false);
}
// Unset wildcarded for all but the the last icon.
source.set_size_wildcarded(icon == stock.n_icons - 1);
icon_set.add_source(source);
}
const Gtk::StockID stock_id (stock.id);
factory->add(stock_id, icon_set);
Gtk::Stock::add(Gtk::StockItem(stock_id, stock.label));
}
......@@ -117,7 +120,7 @@ void regexxer_set_window_icon()
catch(const Glib::Error& error)
{
const Glib::ustring what = error.what();
g_warning(what.c_str());
g_warning("%s", what.c_str());
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment