From: Thomas Debesse Date: Mon, 20 Jun 2022 02:48:59 +0000 (+0200) Subject: Merge commit '71ef2336cbab4cca1d1b228cdb89601f6569c107' into master-merge X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=006cde32550a089f9dc6045d41b922a7d6bc1ed4;p=xonotic%2Fnetradiant.git Merge commit '71ef2336cbab4cca1d1b228cdb89601f6569c107' into master-merge --- 006cde32550a089f9dc6045d41b922a7d6bc1ed4 diff --cc libs/gtkutil/window.cpp index 80b79738,c1613500..c8671a2f --- a/libs/gtkutil/window.cpp +++ b/libs/gtkutil/window.cpp @@@ -28,17 -28,16 +28,26 @@@ inline void CHECK_RESTORE( ui::Widget w ){ if ( gpointer_to_int( g_object_get_data( G_OBJECT( w ), "was_mapped" ) ) != 0 ) { + +#ifdef WORKAROUND_WINDOWS_GTK2_GLWIDGET + /* workaround for gtk 2.24 issue: not displayed glwidget after toggle */ + GtkWidget* glwidget = GTK_WIDGET( g_object_get_data( G_OBJECT( w ), "glwidget" ) ); + if ( glwidget ){ + gtk_widget_hide( glwidget ); + gtk_widget_show( glwidget ); + } +#endif // WORKAROUND_WINDOWS_GTK2_GLWIDGET + w.show(); + #define GARUX_GTK_WORKAROUND + #ifndef GARUX_GTK_WORKAROUND + /* workaround for gtk 2.24 issue: not displayed glwidget after min/restore */ + GtkWidget* glwidget = GTK_WIDGET( g_object_get_data( G_OBJECT( w ), "glwidget" ) ); + if ( glwidget ){ + gtk_widget_hide( glwidget ); + gtk_widget_show( glwidget ); + } + #endif } } diff --cc radiant/mainframe.cpp index df57ccb7,8581cc4c..c4137081 --- a/radiant/mainframe.cpp +++ b/radiant/mainframe.cpp @@@ -3072,13 -2984,14 +3072,15 @@@ void MainFrame::Create() window.show(); - if ( CurrentStyle() == eRegular || CurrentStyle() == eRegularLeft ) { + if ( CurrentStyle() == eRegular || CurrentStyle() == eRegularLeft ) + { { ui::Widget hsplit = ui::HPaned(ui::New); - m_vSplit = hsplit; + m_hSplit = hsplit; + vbox.pack_start( hsplit, TRUE, TRUE, 0 ); hsplit.show(); + { ui::Widget vsplit = ui::VPaned(ui::New); vsplit.show(); diff --cc radiant/texwindow.cpp index 81d1edc0,7a24d67f..32c4a813 --- a/radiant/texwindow.cpp +++ b/radiant/texwindow.cpp @@@ -2303,18 -2213,18 +2329,18 @@@ ui::Widget TextureBrowser_constructWind auto tools_item = TextureBrowser_constructToolsMenu( menu_tools ); gtk_menu_item_set_submenu( GTK_MENU_ITEM( tools_item ), menu_tools ); gtk_menu_shell_append( GTK_MENU_SHELL( menu_bar ), tools_item ); - - table.attach(menu_bar, {0, 3, 0, 1}, {GTK_FILL, GTK_SHRINK}); - menu_bar.show(); + */ + // table.attach(menu_bar, {0, 3, 0, 1}, {GTK_FILL, GTK_SHRINK}); + // menu_bar.show(); } { // Texture TreeView - g_TextureBrowser.m_scr_win_tree = ui::ScrolledWindow(ui::New); - gtk_container_set_border_width( GTK_CONTAINER( g_TextureBrowser.m_scr_win_tree ), 0 ); + textureBrowser.m_scr_win_tree = ui::ScrolledWindow(ui::New); + gtk_container_set_border_width( GTK_CONTAINER( textureBrowser.m_scr_win_tree ), 0 ); // vertical only scrolling for treeview - gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW( g_TextureBrowser.m_scr_win_tree ), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS ); + gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW( textureBrowser.m_scr_win_tree ), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS ); - g_TextureBrowser.m_scr_win_tree.show(); + textureBrowser.m_scr_win_tree.show(); TextureBrowser_createTreeViewTree(); @@@ -2371,16 -2273,21 +2397,21 @@@ } { // tag menu bar auto menu_tags = ui::Menu(ui::New); - auto tags_item = TextureBrowser_constructTagsMenu( menu_tags ); - gtk_menu_item_set_submenu( GTK_MENU_ITEM( tags_item ), menu_tags ); - gtk_menu_shell_append( GTK_MENU_SHELL( menu_bar ), tags_item ); + // auto tags_item = TextureBrowser_constructTagsMenu( menu_tags ); + TextureBrowser_constructTagsMenu( menu_tags ); + // gtk_menu_item_set_submenu( GTK_MENU_ITEM( tags_item ), menu_tags ); + // gtk_menu_shell_append( GTK_MENU_SHELL( menu_bar ), tags_item ); + + auto button = toolbar_append_button( toolbar, "Tags", "texbro_tags.png" ); + button.dimensions( 22, 22 ); + button.connect( "clicked", G_CALLBACK( Popup_View_Menu ), menu_tags ); } { // Tag TreeView - g_TextureBrowser.m_scr_win_tags = ui::ScrolledWindow(ui::New); - gtk_container_set_border_width( GTK_CONTAINER( g_TextureBrowser.m_scr_win_tags ), 0 ); + textureBrowser.m_scr_win_tags = ui::ScrolledWindow(ui::New); + gtk_container_set_border_width( GTK_CONTAINER( textureBrowser.m_scr_win_tags ), 0 ); // vertical only scrolling for treeview - gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW( g_TextureBrowser.m_scr_win_tags ), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS ); + gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW( textureBrowser.m_scr_win_tags ), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS ); TextureBrowser_createTreeViewTags(); @@@ -3059,8 -2903,6 +3094,12 @@@ void TextureBrowser_Destroy() Textures_setModeChangedNotify( Callback() ); } + ui::Widget TextureBrowser_getGLWidget(){ + return GlobalTextureBrowser().m_gl_widget; + } ++ +#if WORKAROUND_WINDOWS_GTK2_GLWIDGET +ui::GLArea TextureBrowser_getGLWidget(){ + return GlobalTextureBrowser().m_gl_widget; +} +#endif // WORKAROUND_WINDOWS_GTK2_GLWIDGET