Fix panel min/maximized loading and save scrollbar position - Alex
authorterminatorX <>
Tue, 2 Nov 2004 21:37:02 +0000 (21:37 +0000)
committerterminatorX <>
Tue, 2 Nov 2004 21:37:02 +0000 (21:37 +0000)
ChangeLog
src/tX_mastergui.cc
src/tX_vtt.cc
src/tX_vtt.h
src/tX_vttfx.cc

index 7119b5b66e2e61eb092d376fd803bbe499c492b8..4c351d74e0ff543738fda89e2e48a99d5012e38c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,8 @@
    Copyright (C) 1999-2004 Alexander K├Ânig
 
    Version 3.82
+     * the position of the audio control scrollbars is now saved within
+       set files and restored upon loading.
      * fixed a liblrdf related issue resulting in use of previously
        free'd memory.
      * rendered a new knob with the wonderful povray - all images are now
index cada8ed3612bf7a77ad4ef85560fac8c3dde02d3..945493b671697f71a0aa4bcd054d37ec8c92fd6c 100644 (file)
@@ -1530,10 +1530,10 @@ void create_mastergui(int x, int y)
        
        tt_parent=dummy;
 
-    panel_bar=gtk_hbox_new(TRUE,2);
+    panel_bar=gtk_hbox_new(TRUE,0);
        gtk_box_pack_start(GTK_BOX(left_hbox), panel_bar, WID_FIX);
 
-       control_parent=gtk_hbox_new(FALSE,0);
+       control_parent=gtk_hbox_new(FALSE,4);
        gtk_box_pack_start(GTK_BOX(tt_parent), control_parent, WID_FIX);
        gtk_widget_show(control_parent);
 
index 2dd43e3d42e18a6ca99ea680924b0408ad11c4b7..c22a932cb6136acdc875c9656b387d6d14f78047 100644 (file)
@@ -1278,6 +1278,9 @@ int  vtt_class :: save(FILE *rc, gzFile rz, char *indent) {
        store_bool("mix_solo", mix_solo);
        store_float("audio_x_zoom", gui_get_audio_x_zoom(this));
        
+       GtkAdjustment *adj = gtk_scrolled_window_get_vadjustment(GTK_SCROLLED_WINDOW (gui.scrolled_win));
+       store_float("control_adjustment", gtk_adjustment_get_value(adj));
+       
        tX_store("%s<fx>\n", indent);
        strcat(indent, "\t");
        
@@ -1298,7 +1301,7 @@ int  vtt_class :: save(FILE *rc, gzFile rz, char *indent) {
                
        indent[strlen(indent)-1]=0;
        tX_store("%s</turntable>\n", indent);
-       
+               
        return(res);
 }
 
@@ -1342,6 +1345,8 @@ int vtt_class :: load(xmlDocPtr doc, xmlNodePtr node) {
        double tmp;
        char tmp_xml_buffer[4096];
        
+       control_scroll_adjustment = 0.0;
+       
        for (xmlNodePtr cur=node->xmlChildrenNode; cur != NULL; cur = cur->next) {
                if (cur->type == XML_ELEMENT_NODE) {
                        elementFound=0;
@@ -1381,11 +1386,12 @@ int vtt_class :: load(xmlDocPtr doc, xmlNodePtr node) {
        
                        restore_bool("audio_panel_hidden", audio_hidden);
                        restore_bool("control_panel_hidden", control_hidden);
-                       restore_bool_ac("main_panel_hidden", hidden, gui.main_panel->hide(hidden));
-                       restore_bool_ac("trigger_panel_hidden", hidden, gui.trigger_panel->hide(hidden));
-                       restore_bool_ac("lowpass_panel_hidden", hidden, gui.lp_panel->hide(hidden));                    
-                       restore_bool_ac("echo_panel_hidden", hidden, gui.ec_panel->hide(hidden));
+                       restore_bool_ac("main_panel_hidden", hidden, gui.main_panel->hide(!hidden));
+                       restore_bool_ac("trigger_panel_hidden", hidden, gui.trigger_panel->hide(!hidden));
+                       restore_bool_ac("lowpass_panel_hidden", hidden, gui.lp_panel->hide(!hidden));                   
+                       restore_bool_ac("echo_panel_hidden", hidden, gui.ec_panel->hide(!hidden));
                        restore_float_ac("audio_x_zoom", tmp, gui_set_audio_x_zoom(this,tmp));
+                       restore_float("control_adjustment", control_scroll_adjustment);
                        vg_adjust_zoom(gui.zoom, this);
                        
                        if ((xmlStrcmp(cur->name, (xmlChar *) "fx")==0) || 
@@ -1480,7 +1486,7 @@ int vtt_class :: load(xmlDocPtr doc, xmlNodePtr node) {
        
        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(gui.mute), mix_mute);
        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(gui.solo), mix_solo);
-
+       
        return 0;
 }
 
@@ -1580,7 +1586,7 @@ int vtt_class :: load_all(xmlDocPtr doc, char *fname) {
                                gtk_box_pack_start(GTK_BOX(control_parent), vtt->gui.control_box, TRUE, TRUE, 0);
                                gtk_box_pack_start(GTK_BOX(audio_parent), vtt->gui.audio_box, TRUE, TRUE, 0);
                                if (vtt->audio_hidden) vtt->hide_audio(vtt->audio_hidden);
-                               if (vtt->control_hidden) vtt->hide_control(vtt->control_hidden);
+                               if (vtt->control_hidden) vtt->hide_control(vtt->control_hidden);                                
                        }
                        if ((!elementFound) && (xmlStrcmp(cur->name, (xmlChar *) "sequencer")==0)) {
                                elementFound=1;
@@ -1594,6 +1600,15 @@ int vtt_class :: load_all(xmlDocPtr doc, char *fname) {
        
        sp_master_volume.do_update_graphics();
        sp_master_pitch.do_update_graphics();
+
+       while (gtk_events_pending()) gtk_main_iteration();
+
+       list <vtt_class *> :: iterator vtt;
+
+       for (vtt=main_list.begin(); vtt!=main_list.end(); vtt++) {
+               GtkAdjustment *adj = gtk_scrolled_window_get_vadjustment(GTK_SCROLLED_WINDOW((*vtt)->gui.scrolled_win));
+               gtk_adjustment_set_value(adj, (*vtt)->control_scroll_adjustment);
+       }
        
        ld_destroy();
        
index d316ae82fdb016c27a426208f340444a3cdf91e4..4e3957fce10d5ca94a4cb7d08c2bf8d77c36f90d 100644 (file)
@@ -97,6 +97,7 @@ class vtt_class
        
        bool control_hidden;
        bool audio_hidden;
+       double control_scroll_adjustment;
        
        /* builtin fx */
        vtt_fx* lp_fx;
index 71d980273eef73f64c7ca7067d41cf5bbb2dc726..ccc8782cd07a802f5799aa876ea042bf039da82f 100644 (file)
@@ -333,7 +333,7 @@ void vtt_fx_ladspa :: load(xmlDocPtr doc, xmlNodePtr node) {
                }
        }
        
-       panel->hide(hidden);
+       panel->hide(!hidden);
 }
 
 void vtt_fx_ladspa :: toggle_drywet() {