add 'v' shortcut in resource wdw, sams proxy icons, update shortcuts doc
[goodguy/history.git] / cinelerra-5.1 / cinelerra / awindowgui.C
index 505f32f16cd2c191e3b8d6d19c01dbaedf76fcf1..4b9a912d3fd8774f77b23ef2cd38393d156560e2 100644 (file)
@@ -1202,6 +1202,39 @@ void AWindowGUI::stop_vicon_drawing()
        vicon_thread->stop_drawing();
 }
 
        vicon_thread->stop_drawing();
 }
 
+int AWindowGUI::cycle_assetlist_format()
+{
+       EDLSession *session = mwindow->edl->session;
+       int format = ASSETS_TEXT;
+       if( allow_iconlisting ) {
+               switch( session->assetlist_format ) {
+               case ASSETS_TEXT:
+                       format = ASSETS_ICONS;
+                       break;
+               case ASSETS_ICONS:
+                       format = ASSETS_ICONS_PACKED;
+                       break;
+               case ASSETS_ICONS_PACKED:
+                       format = ASSETS_ICON_LIST;
+                       break;
+               case ASSETS_ICON_LIST:
+                       format = ASSETS_TEXT;
+                       break;
+               }
+       }
+       stop_vicon_drawing();
+       session->assetlist_format = format;
+       asset_list->update_format(session->assetlist_format, 0);
+       int x0 = 0;
+       int x1 = asset_list->get_w();
+       int y0 = asset_list->get_title_h();
+       int y1 = asset_list->get_h();
+       vicon_thread->set_drawing_area(x0,y0, x1,y1);
+       async_update_assets();
+       start_vicon_drawing();
+       return 1;
+}
+
 AWindowRemovePluginGUI::
 AWindowRemovePluginGUI(AWindow *awindow, AWindowRemovePlugin *thread,
        int x, int y, PluginServer *plugin)
 AWindowRemovePluginGUI::
 AWindowRemovePluginGUI(AWindow *awindow, AWindowRemovePlugin *thread,
        int x, int y, PluginServer *plugin)
@@ -1337,6 +1370,8 @@ int AWindowGUI::keypress_event()
                        return 1;
                }
                break;
                        return 1;
                }
                break;
+       case 'v':
+               return cycle_assetlist_format();
        case DELETE:
                if( shift_down() ) {
                        PluginServer* plugin = selected_plugin();
        case DELETE:
                if( shift_down() ) {
                        PluginServer* plugin = selected_plugin();
@@ -2612,7 +2647,7 @@ int AVIconDrawing::handle_event()
 
 
 AWindowListFormat::AWindowListFormat(MWindow *mwindow, AWindowGUI *gui)
 
 
 AWindowListFormat::AWindowListFormat(MWindow *mwindow, AWindowGUI *gui)
- : BC_MenuItem("")
+ : BC_MenuItem("","v",'v')
 {
        this->mwindow = mwindow;
        this->gui = gui;
 {
        this->mwindow = mwindow;
        this->gui = gui;
@@ -2620,37 +2655,7 @@ AWindowListFormat::AWindowListFormat(MWindow *mwindow, AWindowGUI *gui)
 
 int AWindowListFormat::handle_event()
 {
 
 int AWindowListFormat::handle_event()
 {
-       gui->stop_vicon_drawing();
-
-       EDLSession *session = mwindow->edl->session;
-       if( mwindow->awindow->gui->allow_iconlisting ) {
-               switch( session->assetlist_format ) {
-               case ASSETS_TEXT:
-                       session->assetlist_format = ASSETS_ICONS;
-                       break;
-               case ASSETS_ICONS:
-                       session->assetlist_format = ASSETS_ICONS_PACKED;
-                       break;
-               case ASSETS_ICONS_PACKED:
-                       session->assetlist_format = ASSETS_ICON_LIST;
-                       break;
-               case ASSETS_ICON_LIST:
-                       session->assetlist_format = ASSETS_TEXT;
-                       break;
-               }
-       }
-       else
-               mwindow->edl->session->assetlist_format = ASSETS_TEXT;
-       gui->asset_list->update_format(session->assetlist_format, 0);
-       int x0 = 0;
-       int x1 = gui->asset_list->get_w();
-       int y0 = gui->asset_list->get_title_h();
-       int y1 = gui->asset_list->get_h();
-       gui->vicon_thread->set_drawing_area(x0,y0, x1,y1);
-
-       gui->async_update_assets();
-       gui->start_vicon_drawing();
-       return 1;
+       return gui->cycle_assetlist_format();
 }
 
 void AWindowListFormat::update()
 }
 
 void AWindowListFormat::update()