]> de.git.xonotic.org Git - xonotic/netradiant.git/commitdiff
Merge commit 'f6b9708d076f575f8ecc2baec9d5057824dbfcae' into garux-merge
authorThomas Debesse <dev@illwieckz.net>
Mon, 25 May 2020 11:26:36 +0000 (13:26 +0200)
committerThomas Debesse <dev@illwieckz.net>
Mon, 25 May 2020 11:26:36 +0000 (13:26 +0200)
1  2 
radiant/gtkdlgs.cpp
radiant/patch.cpp
radiant/plugintoolbar.cpp
radiant/qe3.cpp
radiant/texwindow.cpp

index 5c16c70697e68552b7dfa4890f5d0b7c3020513c,57479b321727d8bdf4334e4319090cf24952af55..0a2206069f6a78f98c009dfc6abde978bc32f126
@@@ -798,10 -838,11 +798,11 @@@ static void DoGtkTextEditor( const char
                g_object_set_data( G_OBJECT( text_editor ), "filename", strdup( filename ) );
  
                // trying to show later
 -              gtk_widget_show( text_editor );
 +              text_editor.show();
+               gtk_window_present( GTK_WINDOW( text_editor ) );
  
 -#ifdef WIN32
 -              process_gui();
 +#if GDEF_OS_WINDOWS
 +              ui::process();
  #endif
  
                // only move the cursor if it's not exceeding the size..
Simple merge
index aea1b321b837528586c445ff417f1724b8afde58,8fd420d73046cc1b6ef65bdc96d12bf83da2ea2c..6e24976d212c3a1eef45a14e0d9896b25e1b13bf
@@@ -55,43 -65,39 +55,53 @@@ ui::Image new_plugin_image( const char
        return image_new_missing();
  }
  
 -inline GtkToolbarChildType gtktoolbarchildtype_for_toolbarbuttontype( IToolbarButton::EType type ){
 -      switch ( type )
 -      {
 -      case IToolbarButton::eSpace:
 -              return GTK_TOOLBAR_CHILD_SPACE;
 -      case IToolbarButton::eButton:
 -              return GTK_TOOLBAR_CHILD_BUTTON;
 -      case IToolbarButton::eToggleButton:
 -              return GTK_TOOLBAR_CHILD_TOGGLEBUTTON;
 -      case IToolbarButton::eRadioButton:
 -              return GTK_TOOLBAR_CHILD_RADIOBUTTON;
 +void toolbar_insert( ui::Toolbar toolbar, const char* icon, const char* text, const char* tooltip, IToolbarButton::EType type, GCallback handler, gpointer data ){
 +      if (type == IToolbarButton::eSpace) {
 +              auto it = ui::ToolItem::from(gtk_separator_tool_item_new());
 +              it.show();
 +              toolbar.add(it);
 +              return;
        }
 -      ERROR_MESSAGE( "invalid toolbar button type" );
 -      return (GtkToolbarChildType)0;
 -}
 -
 -void toolbar_insert( GtkToolbar *toolbar, const char* icon, const char* text, const char* tooltip, IToolbarButton::EType type, GtkSignalFunc handler, gpointer data ){
 -      GtkWidget* widget = gtk_toolbar_append_element( toolbar, gtktoolbarchildtype_for_toolbarbuttontype( type ), 0, text, tooltip, "", GTK_WIDGET( new_plugin_image( icon ) ), handler, data );
 -      if( type != IToolbarButton::eSpace ){
++      #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);
 +              gtk_widget_show_all(button);
 +              button.connect("clicked", G_CALLBACK(handler), data);
 +              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));
 +              gtk_tool_button_set_label(button, text);
 +              gtk_widget_set_tooltip_text(button, tooltip);
 +              gtk_widget_show_all(button);
 +              button.connect("toggled", G_CALLBACK(handler), data);
 +              toolbar.add(button);
 +              return;
 +      }
++
 +      ERROR_MESSAGE( "invalid toolbar button type" );
  }
  
 -void ActivateToolbarButton( GtkWidget *widget, gpointer data ){
 -      const_cast<const IToolbarButton*>( reinterpret_cast<IToolbarButton*>( data ) )->activate();
 +void ActivateToolbarButton( ui::ToolButton widget, gpointer data ){
 +      (const_cast<const IToolbarButton *>( reinterpret_cast<IToolbarButton *>( data )))->activate();
  }
  
 -void PlugInToolbar_AddButton( GtkToolbar* toolbar, const IToolbarButton* button ){
 -      toolbar_insert( toolbar, button->getImage(), button->getText(), button->getTooltip(), button->getType(), GTK_SIGNAL_FUNC( ActivateToolbarButton ), reinterpret_cast<gpointer>( const_cast<IToolbarButton*>( button ) ) );
 +void PlugInToolbar_AddButton( ui::Toolbar toolbar, const IToolbarButton* button ){
 +      toolbar_insert( toolbar, button->getImage(), button->getText(), button->getTooltip(), button->getType(), G_CALLBACK( ActivateToolbarButton ), reinterpret_cast<gpointer>( const_cast<IToolbarButton*>( button ) ) );
  }
  
 -GtkToolbar* g_plugin_toolbar = 0;
 +ui::Toolbar g_plugin_toolbar{ui::null};
  
  void PluginToolbar_populate(){
        class AddToolbarItemVisitor : public ToolbarModules::Visitor
diff --cc radiant/qe3.cpp
index b073752126670a97ea9707cb5c0115850e0da4ae,82d5d85571d3233f08fbffaffa78741547ef181c..efae51c42438df2c94ea4dbb88e260a618814f8c
@@@ -92,7 -83,7 +92,7 @@@ void QE_InitVFS()
        // if we have a mod dir
        if ( !string_equal( gamename, basegame ) ) {
                // ~/.<gameprefix>/<fs_game>
-               if ( userRoot && !g_disableHomePath ) {
 -              if ( userRoot && !string_equal( globalRoot, userRoot ) ) {
++              if ( userRoot && !string_equal( globalRoot, userRoot ) && !g_disableHomePath ) {
                        StringOutputStream userGamePath( 256 );
                        userGamePath << userRoot << gamename << '/';
                        GlobalFileSystem().initDirectory( userGamePath.c_str() );
        }
  
        // ~/.<gameprefix>/<fs_main>
-       if ( userRoot && !g_disableHomePath ) {
 -      if ( userRoot && !string_equal( globalRoot, userRoot ) ) {
++      if ( userRoot && !string_equal( globalRoot, userRoot ) && !g_disableHomePath ) {
                StringOutputStream userBasePath( 256 );
                userBasePath << userRoot << basegame << '/';
                GlobalFileSystem().initDirectory( userBasePath.c_str() );
index 6c17ba96639f58ad4ff8ebdd84b6cdd859ef9cb3,d18a152e8333fdc3efcbe67ef4bcc3bc2c1ba118..72573afe8dd64fc723a29a5934d245464b3c48c1
@@@ -1525,10 -1423,9 +1525,11 @@@ gboolean TextureBrowser_button_press( u
                        }
                }
        }
-       else if ( event->type == GDK_2BUTTON_PRESS ) {
+       else if ( event->type == GDK_2BUTTON_PRESS && event->button == 1 ) {
 +              #define GARUX_DISABLE_2BUTTON
 +              #ifndef GARUX_DISABLE_2BUTTON
+               CopiedString texName = textureBrowser->shader;
 -              const char* sh = texName.c_str();
 +              const char* sh = textureBrowser->shader.c_str();
                char* dir = strrchr( sh, '/' );
                if( dir != NULL ){
                        *(dir + 1) = '\0';
                                }
                        }
                }
 +              #endif
        }
-       else if ( event->type == GDK_3BUTTON_PRESS ) {
+       else if ( event->type == GDK_2BUTTON_PRESS && event->button == 3 ) {
                ScopeDisableScreenUpdates disableScreenUpdates( TextureBrowser_getComonShadersDir(), "Loading Textures" );
                TextureBrowser_ShowDirectory( *textureBrowser, TextureBrowser_getComonShadersDir() );
                TextureBrowser_queueDraw( *textureBrowser );