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
}
}
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();
}
{ // 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();
Textures_setModeChangedNotify( Callback<void()>() );
}
+ 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