]> git.xonotic.org Git - xonotic/netradiant.git/blobdiff - radiant/plugintoolbar.cpp
Merge commit '5e3961896b9e30ebbc736b542f177054188c05bf' into master-merge
[xonotic/netradiant.git] / radiant / plugintoolbar.cpp
index aea1b321b837528586c445ff417f1724b8afde58..25ff2cd49fc8fbd7ee714e8931bcc99e11cf9aa7 100644 (file)
@@ -42,13 +42,13 @@ ui::Image new_plugin_image( const char* filename ){
 
        {
                StringOutputStream fullpath( 256 );
-               fullpath << AppPath_get() << g_pluginsDir << "bitmaps/" << filename;
+               fullpath << DataPath_get() << g_pluginsDir << "bitmaps/" << filename;
                if ( auto image = image_new_from_file_with_mask(fullpath.c_str()) ) return image;
        }
 
        {
                StringOutputStream fullpath( 256 );
-               fullpath << AppPath_get() << g_modulesDir << "bitmaps/" << filename;
+               fullpath << DataPath_get() << g_modulesDir << "bitmaps/" << filename;
                if ( auto image = image_new_from_file_with_mask(fullpath.c_str()) ) return image;
        }
 
@@ -62,6 +62,14 @@ void toolbar_insert( ui::Toolbar toolbar, const char* icon, const char* text, co
                toolbar.add(it);
                return;
        }
+       #define GARUX_DISABLE_SPACER_NOFOCUS
+       #ifndef GARUX_DISABLE_SPACER_NOFOCUS
+       else {
+               GTK_WIDGET_UNSET_FLAGS( widget, GTK_CAN_FOCUS );
+               GTK_WIDGET_UNSET_FLAGS( widget, GTK_CAN_DEFAULT );
+       }
+       #endif // GARUX_DISABLE_SPACER_NOFOCUS
+
        if (type == IToolbarButton::eButton) {
                auto button = ui::ToolButton::from(gtk_tool_button_new(new_plugin_image(icon), text));
                gtk_widget_set_tooltip_text(button, tooltip);
@@ -70,6 +78,7 @@ void toolbar_insert( ui::Toolbar toolbar, const char* icon, const char* text, co
                toolbar.add(button);
                return;
        }
+
        if (type == IToolbarButton::eToggleButton) {
                auto button = ui::ToolButton::from(gtk_toggle_tool_button_new());
                gtk_tool_button_set_icon_widget(button, new_plugin_image(icon));
@@ -80,6 +89,7 @@ void toolbar_insert( ui::Toolbar toolbar, const char* icon, const char* text, co
                toolbar.add(button);
                return;
        }
+
        ERROR_MESSAGE( "invalid toolbar button type" );
 }