]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - radiant/entityinspector.cpp
- Fix for bug 1106 - .wad files don't get listed in the textures menu (Shaderman)
[xonotic/netradiant.git] / radiant / entityinspector.cpp
index a3e445baecf65340d4f814523ac76ea3b2909e93..de3086d8afa9fa6c018c0a7cae4e060ed5cbc235 100644 (file)
@@ -277,7 +277,7 @@ public:
   typedef MemberCaller<ModelAttribute, &ModelAttribute::update> UpdateCaller;
   void browse(const BrowsedPathEntry::SetPathCallback& setPath)
   {
-    const char *filename = misc_model_dialog(GTK_WIDGET(m_entry.m_entry.m_frame));
+    const char *filename = misc_model_dialog(gtk_widget_get_toplevel(GTK_WIDGET(m_entry.m_entry.m_frame)));
     
     if(filename != 0)
     {
@@ -1010,7 +1010,10 @@ void EntityClassList_selectEntityClass(EntityClass* eclass)
       GtkTreeView* view = g_entityClassList;
       GtkTreePath* path = gtk_tree_model_get_path(model, &iter);
       gtk_tree_selection_select_path(gtk_tree_view_get_selection(view), path);
-      gtk_tree_view_scroll_to_cell(view, path, 0, FALSE, 0, 0);
+      if(GTK_WIDGET_REALIZED(view))
+      {
+        gtk_tree_view_scroll_to_cell(view, path, 0, FALSE, 0, 0);
+      }
       gtk_tree_path_free(path);
       good = FALSE;
     }
@@ -1361,7 +1364,10 @@ static gint EntityClassList_keypress(GtkWidget* widget, GdkEventKey* event, gpoi
       {
         GtkTreePath* path = gtk_tree_model_get_path(model, &iter);
         gtk_tree_selection_select_path(gtk_tree_view_get_selection(view), path);
-        gtk_tree_view_scroll_to_cell(view, path, 0, FALSE, 0, 0);
+        if(GTK_WIDGET_REALIZED(view))
+        {
+          gtk_tree_view_scroll_to_cell(view, path, 0, FALSE, 0, 0);
+        }
         gtk_tree_path_free(path);
         count = 1;
       }
@@ -1672,22 +1678,27 @@ GtkWidget* EntityInspector_constructWindow(GtkWindow* toplevel)
 
 
   {
-    int x = g_entitysplit1_position;
-    if (x != -1)
+    // show the sliders in any case
+    if(g_entitysplit2_position > 22)
     {
-      gtk_paned_set_position(GTK_PANED(g_entity_split1), x);
-
-      x = g_entitysplit2_position;
-
-      if (x != -1)
-        gtk_paned_set_position (GTK_PANED(g_entity_split2), x);
+      gtk_paned_set_position (GTK_PANED(g_entity_split2), g_entitysplit2_position);
+    } else {
+      g_entitysplit2_position = 22;
+      gtk_paned_set_position (GTK_PANED(g_entity_split2), 22);
+    }
+    if((g_entitysplit1_position - g_entitysplit2_position) > 27)
+    {
+      gtk_paned_set_position (GTK_PANED(g_entity_split1), g_entitysplit1_position);
+    } else {
+      gtk_paned_set_position (GTK_PANED(g_entity_split1), g_entitysplit2_position + 27);
     }
   }
 
   g_entityInspector_windowConstructed = true;
   EntityClassList_fill();
 
-  GlobalSelectionSystem().addSelectionChangeCallback(FreeCaller1<const Selectable&, EntityInspector_selectionChanged>());
+  typedef FreeCaller1<const Selectable&, EntityInspector_selectionChanged> EntityInspectorSelectionChangedCaller;
+  GlobalSelectionSystem().addSelectionChangeCallback(EntityInspectorSelectionChangedCaller());
   GlobalEntityCreator().setKeyValueChangedFunc(EntityInspector_keyValueChanged);
 
   // hack