ffmpeg seek fixes, asset only pastes, plugin info, remove vocoder, misc fixes
[goodguy/history.git] / cinelerra-5.1 / guicast / bclistbox.C
index 7a521a310d2244edfcd69bf17975ff57c7909ed8..fe954f89e36c317d8d0e78ffe955dee478a87fe7 100644 (file)
@@ -64,6 +64,10 @@ int BC_ListBoxYScroll::handle_event()
        return 1;
 }
 
+int BC_ListBoxYScroll::update_length(int64_t length, int64_t position, int64_t handlelength, int flush)
+{
+       return BC_ScrollBar::update_length(length+handlelength/4, position, handlelength, flush);
+}
 
 
 
@@ -95,6 +99,10 @@ int BC_ListBoxXScroll::handle_event()
        return 1;
 }
 
+int BC_ListBoxXScroll::update_length(int64_t length, int64_t position, int64_t handlelength, int flush)
+{
+       return BC_ScrollBar::update_length(length+handlelength/4, position, handlelength, flush);
+}
 
 
 
@@ -1061,7 +1069,7 @@ int BC_ListBox::get_text_w(BC_ListBoxItem *item)
 int BC_ListBox::get_text_h(BC_ListBoxItem *item)
 {
        int h = item->get_text_h();
-       if( h < 0 ) item->set_text_h(h = get_text_height(MEDIUMFONT));
+       if( h < 0 ) item->set_text_h(h = get_text_height(MEDIUMFONT, item->get_text()));
        return h;
 }
 
@@ -1362,6 +1370,8 @@ int BC_ListBox::get_text_mask(BC_ListBoxItem *item,
        {
                w = get_text_width(MEDIUMFONT, item->text) + LISTBOX_MARGIN * 2;
                h = row_height;
+               int ih = get_icon_h(item);
+               if( h < ih ) h = ih;
        }
        return 0;
 }
@@ -3979,6 +3989,7 @@ int BC_ListBox::deactivate()
 int BC_ListBox::activate(int take_focus)
 {
        if( active ) return 0;
+       active = 1;
        if( take_focus )
                set_active_subwindow(this);
        button_releases = 0;
@@ -3997,11 +4008,11 @@ int BC_ListBox::activate(int take_focus)
 
 int BC_ListBox::activate(int x, int y, int w, int h)
 {
-       if( active || !is_popup || gui ) return 0;
+       if( !is_popup || gui ) return 0;
+       active = 1;
        if(w != -1) popup_w = w;
        if(h != -1) popup_h = h;
        reset_query();
-       active = 1;
        if( y + popup_h > top_level->get_root_h(0) )
                y -= get_h() + popup_h;
        add_subwindow(gui = new BC_Popup(this,
@@ -4403,9 +4414,14 @@ void BC_ListBox::draw_text_recursive(ArrayList<BC_ListBoxItem*> *data,
                                gui->set_color(row_color);
                                gui->draw_box(x, y, column_width, h);
                                gui->set_color(BLACK);
-                               int yy = y, xx = x + column_width-1;
-                               gui->draw_line(x, yy, xx, yy);
-                               yy = y + row_height;
+                               int xx = x + column_width-1;
+                               gui->draw_line(x, y, xx, y);
+                               int hh = row_height;
+                               if( display_format == LISTBOX_ICON_LIST ) {
+                                       int ih = get_icon_h(item);
+                                       if( ih > hh ) hh = ih;
+                               }
+                               int yy = y + hh-1;
                                gui->draw_line(x, yy, xx, yy);
                        }