inline void CHECK_RESTORE( GtkWidget* w ){
if ( gpointer_to_int( g_object_get_data( G_OBJECT( w ), "was_mapped" ) ) != 0 ) {
gtk_widget_show( w );
+ /* 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 );
+ }
}
}
inline void CHECK_MINIMIZE( GtkWidget* w ){
g_object_set_data( G_OBJECT( w ), "was_mapped", gint_to_pointer( GTK_WIDGET_VISIBLE( w ) ) );
- gtk_widget_hide( w );
+ //gtk_widget_hide( w ); //fix for gtk 2.24 + the whole scheme isn't needed with gtk 2.16, 2.24; they do it all alone
}
static gboolean main_window_iconified( GtkWidget* widget, GdkEventWindowState* event, gpointer data ){
connect_floating_window_destroy_present( window, parent );
g_object_set_data( G_OBJECT( window ), "floating_handler", gint_to_pointer( connect_floating( parent, window ) ) );
g_signal_connect( G_OBJECT( window ), "destroy", G_CALLBACK( destroy_disconnect_floating ), parent );
+/*
+ //gtk_window_set_type_hint (window,GDK_WINDOW_TYPE_HINT_UTILITY);
+ //gtk_window_set_type_hint (window,GDK_WINDOW_TYPE_HINT_DIALOG);
+ gtk_window_set_keep_above ( window, TRUE );
+ GtkWidget* widget = GTK_WIDGET( window );
+ gtk_widget_realize ( widget );
+ GdkWindow* gdk_window = gtk_widget_get_window( widget );
+ //gdk_window_set_decorations ( gdk_window, (GdkWMDecoration)(GDK_DECOR_BORDER|GDK_DECOR_RESIZEH|GDK_DECOR_TITLE|GDK_DECOR_MENU|GDK_DECOR_MINIMIZE|GDK_DECOR_MAXIMIZE) );
+ //gdk_window_set_functions ( gdk_window, (GdkWMFunction)( GDK_FUNC_RESIZE|GDK_FUNC_MOVE|GDK_FUNC_MINIMIZE|GDK_FUNC_MAXIMIZE|GDK_FUNC_CLOSE ) );
+ //gdk_window_set_decorations ( gdk_window, (GdkWMDecoration)( GDK_DECOR_ALL ) );
+ //gdk_window_set_functions ( gdk_window, (GdkWMFunction)( GDK_FUNC_ALL ) );
+ //gdk_window_set_type_hint ( gdk_window, GDK_WINDOW_TYPE_HINT_DIALOG );
+ //gdk_window_set_type_hint ( gdk_window, GDK_WINDOW_TYPE_HINT_UTILITY );
+ //gdk_window_set_type_hint ( gdk_window, GDK_WINDOW_TYPE_HINT_NORMAL );
+ gdk_window_set_skip_taskbar_hint ( gdk_window, TRUE );
+ gdk_window_set_skip_pager_hint ( gdk_window, TRUE );
+*/
}
return window;
gtk_container_add( GTK_CONTAINER( window ), GTK_WIDGET( frame ) );
}
CamWnd_setParent( *m_pCamWnd, window );
+ /* workaround for gtk 2.24 issue: not displayed glwidget after toggle */
+ g_object_set_data( G_OBJECT( window ), "glwidget", CamWnd_getWidget( *m_pCamWnd ) );
g_floating_windows.push_back( GTK_WIDGET( window ) );
}
gtk_container_add( GTK_CONTAINER( window ), GTK_WIDGET( frame ) );
}
XY_Top_Shown_Construct( window );
+ /* workaround for gtk 2.24 issue: not displayed glwidget after toggle */
+ g_object_set_data( G_OBJECT( window ), "glwidget", m_pXYWnd->GetWidget() );
g_floating_windows.push_back( GTK_WIDGET( window ) );
}
}
XZ_Front_Shown_Construct( window );
+ /* workaround for gtk 2.24 issue: not displayed glwidget after toggle */
+ g_object_set_data( G_OBJECT( window ), "glwidget", m_pXZWnd->GetWidget() );
g_floating_windows.push_back( GTK_WIDGET( window ) );
}
}
YZ_Side_Shown_Construct( window );
+ /* workaround for gtk 2.24 issue: not displayed glwidget after toggle */
+ g_object_set_data( G_OBJECT( window ), "glwidget", m_pYZWnd->GetWidget() );
g_floating_windows.push_back( GTK_WIDGET( window ) );
}
{
GtkFrame* frame = create_framed_widget( TextureBrowser_constructWindow( GroupDialog_getWindow() ) );
g_page_textures = GroupDialog_addPage( "Textures", GTK_WIDGET( frame ), TextureBrowserExportTitleCaller() );
+ /* workaround for gtk 2.24 issue: not displayed glwidget after toggle */
+ g_object_set_data( G_OBJECT( GroupDialog_getWindow() ), "glwidget", TextureBrowser_getGLWidget() );
+
}
GroupDialog_show();
{
GtkFrame* frame = create_framed_widget( TextureBrowser_constructWindow( window ) );
g_page_textures = GroupDialog_addPage( "Textures", GTK_WIDGET( frame ), TextureBrowserExportTitleCaller() );
+ /* workaround for gtk 2.24 issue: not displayed glwidget after toggle */
+ g_object_set_data( G_OBJECT( GroupDialog_getWindow() ), "glwidget", TextureBrowser_getGLWidget() );
}
}
void realise(){
m_realiseCallbacks();
/* texturebrowser tree update on vfs restart */
- TextureBrowser_constructTreeStore();
+// TextureBrowser_constructTreeStore();
}
void unrealise(){
}
return textures_menu_item;
}
+void Popup_View_Menu( GtkWidget *widget, GtkMenu *menu ){
+ gtk_menu_popup( menu, NULL, NULL, NULL, NULL, 1, gtk_get_current_event_time() );
+}
+
GtkMenuItem* TextureBrowser_constructToolsMenu( GtkMenu* menu ){
GtkMenuItem* textures_menu_item = new_sub_menu_item_with_mnemonic( "_Tools" );
GtkWidget* table = gtk_table_new( 3, 3, FALSE );
GtkWidget* frame_table = NULL;
GtkWidget* vbox = gtk_vbox_new( FALSE, 0 );
- gtk_table_attach( GTK_TABLE( table ), vbox, 0, 1, 1, 3, GTK_FILL, GTK_FILL, 0, 0 );
+ gtk_table_attach( GTK_TABLE( table ), vbox, 0, 1, 0, 3, GTK_FILL, GTK_FILL, 0, 0 );
gtk_widget_show( vbox );
- GtkWidget* menu_bar;
+ //GtkWidget* menu_bar;
+ GtkToolbar* toolbar;
{ // menu bar
- menu_bar = gtk_menu_bar_new();
+ //menu_bar = gtk_menu_bar_new();
GtkWidget* menu_view = gtk_menu_new();
- GtkWidget* view_item = (GtkWidget*)TextureBrowser_constructViewMenu( GTK_MENU( menu_view ) );
- gtk_menu_item_set_submenu( GTK_MENU_ITEM( view_item ), menu_view );
- gtk_menu_bar_append( GTK_MENU_BAR( menu_bar ), view_item );
+ //GtkWidget* view_item = (GtkWidget*)
+ TextureBrowser_constructViewMenu( GTK_MENU( menu_view ) );
+ //gtk_menu_item_set_submenu( GTK_MENU_ITEM( view_item ), menu_view );
+ //gtk_menu_bar_append( GTK_MENU_BAR( menu_bar ), view_item );
+
+
+ toolbar = GTK_TOOLBAR( gtk_toolbar_new() );
+ //gtk_table_attach( GTK_TABLE( table ), GTK_WIDGET( toolbar ), 0, 1, 0, 1, GTK_FILL, GTK_FILL, 0, 0 );
+ gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( toolbar ), FALSE, FALSE, 0 );
+
+ //view menu button
+ GtkButton* button = GTK_BUTTON( gtk_button_new() );
+ button_set_icon( button, "texbro_view.png" );
+ gtk_widget_show( GTK_WIDGET( button ) );
+ gtk_button_set_relief( button, GTK_RELIEF_NONE );
+ gtk_widget_set_size_request( GTK_WIDGET( button ), 22, 22 );
+ GTK_WIDGET_UNSET_FLAGS( GTK_WIDGET( button ), GTK_CAN_FOCUS );
+ GTK_WIDGET_UNSET_FLAGS( GTK_WIDGET( button ), GTK_CAN_DEFAULT );
+ gtk_toolbar_append_element( toolbar, GTK_TOOLBAR_CHILD_WIDGET, GTK_WIDGET( button ), "", "View", "", 0, 0, 0 );
+ g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( Popup_View_Menu ), menu_view );
+
+
+ button = toolbar_append_button( toolbar, "Find / Replace...", "texbro_gtk-find-and-replace.png", "FindReplaceTextures" );
+ gtk_widget_set_size_request( GTK_WIDGET( button ), 22, 22 );
+
+
+ button = toolbar_append_button( toolbar, "Flush & Reload Shaders", "texbro_refresh.png", "RefreshShaders" );
+ gtk_widget_set_size_request( GTK_WIDGET( button ), 22, 22 );
+ gtk_widget_show( GTK_WIDGET( toolbar ) );
+
+/*
GtkWidget* menu_tools = gtk_menu_new();
GtkWidget* tools_item = (GtkWidget*)TextureBrowser_constructToolsMenu( GTK_MENU( menu_tools ) );
gtk_menu_item_set_submenu( GTK_MENU_ITEM( tools_item ), menu_tools );
gtk_menu_bar_append( GTK_MENU_BAR( menu_bar ), tools_item );
-
- gtk_table_attach( GTK_TABLE( table ), menu_bar, 0, 3, 0, 1, GTK_FILL, GTK_SHRINK, 0, 0 );
- gtk_widget_show( menu_bar );
+*/
+ //gtk_table_attach( GTK_TABLE( table ), menu_bar, 0, 3, 0, 1, GTK_FILL, GTK_SHRINK, 0, 0 );
+ //gtk_widget_show( menu_bar );
}
{ // Texture TreeView
g_TextureBrowser.m_scr_win_tree = gtk_scrolled_window_new( NULL, NULL );
}
{ // tag menu bar
GtkWidget* menu_tags = gtk_menu_new();
- GtkWidget* tags_item = (GtkWidget*)TextureBrowser_constructTagsMenu( GTK_MENU( menu_tags ) );
- gtk_menu_item_set_submenu( GTK_MENU_ITEM( tags_item ), menu_tags );
- gtk_menu_bar_append( GTK_MENU_BAR( menu_bar ), tags_item );
+ //GtkWidget* tags_item = (GtkWidget*)
+ TextureBrowser_constructTagsMenu( GTK_MENU( menu_tags ) );
+ //gtk_menu_item_set_submenu( GTK_MENU_ITEM( tags_item ), menu_tags );
+ //gtk_menu_bar_append( GTK_MENU_BAR( menu_bar ), tags_item );
+
+ GtkButton* button = GTK_BUTTON( gtk_button_new() );
+ //button_set_icon( button, "texbro_tags.png" );
+ GtkWidget *label = gtk_label_new (">t");
+ gtk_container_add (GTK_CONTAINER (button), label);
+ gtk_widget_show (label);
+
+ gtk_widget_show( GTK_WIDGET( button ) );
+ gtk_button_set_relief( button, GTK_RELIEF_NONE );
+ gtk_widget_set_size_request( GTK_WIDGET( button ), 22, 22 );
+ GTK_WIDGET_UNSET_FLAGS( GTK_WIDGET( button ), GTK_CAN_FOCUS );
+ GTK_WIDGET_UNSET_FLAGS( GTK_WIDGET( button ), GTK_CAN_DEFAULT );
+ gtk_toolbar_append_element( toolbar, GTK_TOOLBAR_CHILD_WIDGET, GTK_WIDGET( button ), "", "Tags", "", 0, 0, 0 );
+ g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( Popup_View_Menu ), menu_tags );
}
{ // Tag TreeView
g_TextureBrowser.m_scr_win_tags = gtk_scrolled_window_new( NULL, NULL );
ScopeDisableScreenUpdates disableScreenUpdates( "Processing...", "Loading Shaders" );
GlobalShaderSystem().refresh();
+ /* texturebrowser tree update on vfs restart */
+ TextureBrowser_constructTreeStore();
UpdateAllWindows();
TextureBrowser_ShowDirectory( GlobalTextureBrowser(), dirName );
else{
ScopeDisableScreenUpdates disableScreenUpdates( "Processing...", "Loading Shaders" );
GlobalShaderSystem().refresh();
+ /* texturebrowser tree update on vfs restart */
+ TextureBrowser_constructTreeStore();
UpdateAllWindows();
}
Textures_setModeChangedNotify( Callback() );
}
+
+GtkWidget* TextureBrowser_getGLWidget(){
+ return GlobalTextureBrowser().m_gl_widget;
+}