Mercurial > audlegacy
comparison src/audacious/ui_main.c @ 2942:1a59a0ced6a8 trunk
make scrolling stop for second when it reaches end, replace remaining mainwin TextBox with UiSkinnedTextbox
author | Tomasz Mon <desowin@gmail.com> |
---|---|
date | Sat, 30 Jun 2007 18:44:20 +0200 |
parents | cd21a4556dd2 |
children | 13591e28d89e |
comparison
equal
deleted
inserted
replaced
2941:d9a2434375f1 | 2942:1a59a0ced6a8 |
---|---|
136 | 136 |
137 static GtkWidget *mainwin_shuffle, *mainwin_repeat; | 137 static GtkWidget *mainwin_shuffle, *mainwin_repeat; |
138 GtkWidget *mainwin_eq, *mainwin_pl; | 138 GtkWidget *mainwin_eq, *mainwin_pl; |
139 | 139 |
140 GtkWidget *mainwin_info; | 140 GtkWidget *mainwin_info; |
141 TextBox *mainwin_stime_min, *mainwin_stime_sec; | 141 GtkWidget *mainwin_stime_min, *mainwin_stime_sec; |
142 | 142 |
143 static TextBox *mainwin_rate_text, *mainwin_freq_text, | 143 static GtkWidget *mainwin_rate_text, *mainwin_freq_text, |
144 *mainwin_othertext; | 144 *mainwin_othertext; |
145 | 145 |
146 PlayStatus *mainwin_playstatus; | 146 PlayStatus *mainwin_playstatus; |
147 | 147 |
148 Number *mainwin_minus_num, *mainwin_10min_num, *mainwin_min_num; | 148 Number *mainwin_minus_num, *mainwin_10min_num, *mainwin_min_num; |
178 | 178 |
179 static gint mainwin_idle_func(gpointer data); | 179 static gint mainwin_idle_func(gpointer data); |
180 | 180 |
181 static void set_timer_mode_menu_cb(TimerMode mode); | 181 static void set_timer_mode_menu_cb(TimerMode mode); |
182 static void set_timer_mode(TimerMode mode); | 182 static void set_timer_mode(TimerMode mode); |
183 | 183 static void change_timer_mode(void); |
184 static void mainwin_refresh_hints(void); | 184 static void mainwin_refresh_hints(void); |
185 | 185 |
186 void mainwin_position_motion_cb(gint pos); | 186 void mainwin_position_motion_cb(gint pos); |
187 void mainwin_position_release_cb(gint pos); | 187 void mainwin_position_release_cb(gint pos); |
188 | 188 |
283 | 283 |
284 ui_skinned_textbox_set_scroll(mainwin_info, FALSE); | 284 ui_skinned_textbox_set_scroll(mainwin_info, FALSE); |
285 if (playback_get_playing()) | 285 if (playback_get_playing()) |
286 { | 286 { |
287 widget_show(WIDGET(mainwin_sposition)); | 287 widget_show(WIDGET(mainwin_sposition)); |
288 widget_show(WIDGET(mainwin_stime_min)); | 288 gtk_widget_show(mainwin_stime_min); |
289 widget_show(WIDGET(mainwin_stime_sec)); | 289 gtk_widget_show(mainwin_stime_sec); |
290 } | 290 } |
291 else | 291 else |
292 { | 292 { |
293 widget_hide(WIDGET(mainwin_sposition)); | 293 widget_hide(WIDGET(mainwin_sposition)); |
294 widget_hide(WIDGET(mainwin_stime_min)); | 294 gtk_widget_hide(mainwin_stime_min); |
295 widget_hide(WIDGET(mainwin_stime_sec)); | 295 gtk_widget_hide(mainwin_stime_sec); |
296 } | 296 } |
297 | 297 |
298 } | 298 } |
299 else { | 299 else { |
300 gint height = !bmp_active_skin->properties.mainwin_height ? MAINWIN_HEIGHT : | 300 gint height = !bmp_active_skin->properties.mainwin_height ? MAINWIN_HEIGHT : |
310 gtk_widget_hide(mainwin_spause); | 310 gtk_widget_hide(mainwin_spause); |
311 gtk_widget_hide(mainwin_sstop); | 311 gtk_widget_hide(mainwin_sstop); |
312 gtk_widget_hide(mainwin_sfwd); | 312 gtk_widget_hide(mainwin_sfwd); |
313 gtk_widget_hide(mainwin_seject); | 313 gtk_widget_hide(mainwin_seject); |
314 | 314 |
315 widget_hide(WIDGET(mainwin_stime_min)); | 315 gtk_widget_hide(mainwin_stime_min); |
316 widget_hide(WIDGET(mainwin_stime_sec)); | 316 gtk_widget_hide(mainwin_stime_sec); |
317 widget_hide(WIDGET(mainwin_sposition)); | 317 widget_hide(WIDGET(mainwin_sposition)); |
318 | 318 |
319 ui_skinned_textbox_set_scroll(mainwin_info, cfg.autoscroll); | 319 ui_skinned_textbox_set_scroll(mainwin_info, cfg.autoscroll); |
320 } | 320 } |
321 | 321 |
597 void | 597 void |
598 mainwin_lock_info_text(const gchar * text) | 598 mainwin_lock_info_text(const gchar * text) |
599 { | 599 { |
600 if (mainwin_info_text_locked != TRUE) | 600 if (mainwin_info_text_locked != TRUE) |
601 mainwin_tb_old_text = g_strdup(bmp_active_skin->properties.mainwin_othertext_is_status ? | 601 mainwin_tb_old_text = g_strdup(bmp_active_skin->properties.mainwin_othertext_is_status ? |
602 mainwin_othertext->tb_text : UI_SKINNED_TEXTBOX(mainwin_info)->text); | 602 UI_SKINNED_TEXTBOX(mainwin_othertext)->text : UI_SKINNED_TEXTBOX(mainwin_info)->text); |
603 | 603 |
604 mainwin_info_text_locked = TRUE; | 604 mainwin_info_text_locked = TRUE; |
605 if (bmp_active_skin->properties.mainwin_othertext_is_status) | 605 if (bmp_active_skin->properties.mainwin_othertext_is_status) |
606 textbox_set_text(mainwin_othertext, text); | 606 ui_skinned_textbox_set_text(mainwin_othertext, text); |
607 else | 607 else |
608 ui_skinned_textbox_set_text(mainwin_info, text); | 608 ui_skinned_textbox_set_text(mainwin_info, text); |
609 } | 609 } |
610 | 610 |
611 void | 611 void |
614 mainwin_info_text_locked = FALSE; | 614 mainwin_info_text_locked = FALSE; |
615 | 615 |
616 if (mainwin_tb_old_text != NULL) | 616 if (mainwin_tb_old_text != NULL) |
617 { | 617 { |
618 if (bmp_active_skin->properties.mainwin_othertext_is_status) | 618 if (bmp_active_skin->properties.mainwin_othertext_is_status) |
619 textbox_set_text(mainwin_othertext, mainwin_tb_old_text); | 619 ui_skinned_textbox_set_text(mainwin_othertext, mainwin_tb_old_text); |
620 else | 620 else |
621 ui_skinned_textbox_set_text(mainwin_info, mainwin_tb_old_text); | 621 ui_skinned_textbox_set_text(mainwin_info, mainwin_tb_old_text); |
622 g_free(mainwin_tb_old_text); | 622 g_free(mainwin_tb_old_text); |
623 mainwin_tb_old_text = NULL; | 623 mainwin_tb_old_text = NULL; |
624 } | 624 } |
649 mainwin_refresh_hints(void) | 649 mainwin_refresh_hints(void) |
650 { | 650 { |
651 if (bmp_active_skin && bmp_active_skin->properties.mainwin_othertext | 651 if (bmp_active_skin && bmp_active_skin->properties.mainwin_othertext |
652 == TRUE) | 652 == TRUE) |
653 { | 653 { |
654 widget_hide(WIDGET(mainwin_rate_text)); | 654 gtk_widget_hide(mainwin_rate_text); |
655 widget_hide(WIDGET(mainwin_freq_text)); | 655 gtk_widget_hide(mainwin_freq_text); |
656 widget_hide(WIDGET(mainwin_monostereo)); | 656 widget_hide(WIDGET(mainwin_monostereo)); |
657 | 657 |
658 if (bmp_active_skin->properties.mainwin_othertext_visible) | 658 if (bmp_active_skin->properties.mainwin_othertext_visible) |
659 widget_show(WIDGET(mainwin_othertext)); | 659 gtk_widget_show(mainwin_othertext); |
660 } | 660 } |
661 else | 661 else |
662 { | 662 { |
663 widget_show(WIDGET(mainwin_rate_text)); | 663 gtk_widget_show(mainwin_rate_text); |
664 widget_show(WIDGET(mainwin_freq_text)); | 664 gtk_widget_show(mainwin_freq_text); |
665 widget_show(WIDGET(mainwin_monostereo)); | 665 widget_show(WIDGET(mainwin_monostereo)); |
666 widget_hide(WIDGET(mainwin_othertext)); | 666 gtk_widget_hide(mainwin_othertext); |
667 } | 667 } |
668 | 668 |
669 /* positioning and size attributes */ | 669 /* positioning and size attributes */ |
670 if (bmp_active_skin->properties.mainwin_vis_x && bmp_active_skin->properties.mainwin_vis_y) | 670 if (bmp_active_skin->properties.mainwin_vis_x && bmp_active_skin->properties.mainwin_vis_y) |
671 widget_move(WIDGET(mainwin_vis), bmp_active_skin->properties.mainwin_vis_x, | 671 widget_move(WIDGET(mainwin_vis), bmp_active_skin->properties.mainwin_vis_x, |
682 if (bmp_active_skin->properties.mainwin_text_width) | 682 if (bmp_active_skin->properties.mainwin_text_width) |
683 gtk_widget_set_size_request(mainwin_info, bmp_active_skin->properties.mainwin_text_width*(1+cfg.doublesize), | 683 gtk_widget_set_size_request(mainwin_info, bmp_active_skin->properties.mainwin_text_width*(1+cfg.doublesize), |
684 UI_SKINNED_TEXTBOX(mainwin_info)->height*(1+cfg.doublesize)); | 684 UI_SKINNED_TEXTBOX(mainwin_info)->height*(1+cfg.doublesize)); |
685 | 685 |
686 if (bmp_active_skin->properties.mainwin_infobar_x && bmp_active_skin->properties.mainwin_infobar_y) | 686 if (bmp_active_skin->properties.mainwin_infobar_x && bmp_active_skin->properties.mainwin_infobar_y) |
687 widget_move(WIDGET(mainwin_othertext), bmp_active_skin->properties.mainwin_infobar_x, | 687 gtk_fixed_move(GTK_FIXED(SKINNED_WINDOW(mainwin)->fixed), GTK_WIDGET(mainwin_othertext), bmp_active_skin->properties.mainwin_infobar_x, |
688 bmp_active_skin->properties.mainwin_infobar_y); | 688 bmp_active_skin->properties.mainwin_infobar_y); |
689 | 689 |
690 if (bmp_active_skin->properties.mainwin_number_0_x && bmp_active_skin->properties.mainwin_number_0_y) | 690 if (bmp_active_skin->properties.mainwin_number_0_x && bmp_active_skin->properties.mainwin_number_0_y) |
691 widget_move(WIDGET(mainwin_minus_num), bmp_active_skin->properties.mainwin_number_0_x, | 691 widget_move(WIDGET(mainwin_minus_num), bmp_active_skin->properties.mainwin_number_0_x, |
692 bmp_active_skin->properties.mainwin_number_0_y); | 692 bmp_active_skin->properties.mainwin_number_0_y); |
789 gtk_widget_show(mainwin_info); | 789 gtk_widget_show(mainwin_info); |
790 else | 790 else |
791 gtk_widget_hide(mainwin_info); | 791 gtk_widget_hide(mainwin_info); |
792 | 792 |
793 if (bmp_active_skin->properties.mainwin_othertext_visible) | 793 if (bmp_active_skin->properties.mainwin_othertext_visible) |
794 widget_show(WIDGET(mainwin_othertext)); | 794 gtk_widget_show(mainwin_othertext); |
795 else | 795 else |
796 widget_hide(WIDGET(mainwin_othertext)); | 796 gtk_widget_hide(mainwin_othertext); |
797 | 797 |
798 if (bmp_active_skin->properties.mainwin_vis_visible) | 798 if (bmp_active_skin->properties.mainwin_vis_visible) |
799 widget_show(WIDGET(mainwin_vis)); | 799 widget_show(WIDGET(mainwin_vis)); |
800 else | 800 else |
801 widget_hide(WIDGET(mainwin_vis)); | 801 widget_hide(WIDGET(mainwin_vis)); |
805 gtk_widget_hide(mainwin_splay); | 805 gtk_widget_hide(mainwin_splay); |
806 gtk_widget_hide(mainwin_spause); | 806 gtk_widget_hide(mainwin_spause); |
807 gtk_widget_hide(mainwin_sstop); | 807 gtk_widget_hide(mainwin_sstop); |
808 gtk_widget_hide(mainwin_sfwd); | 808 gtk_widget_hide(mainwin_sfwd); |
809 gtk_widget_hide(mainwin_seject); | 809 gtk_widget_hide(mainwin_seject); |
810 widget_hide(WIDGET(mainwin_stime_min)); | 810 gtk_widget_hide(mainwin_stime_min); |
811 widget_hide(WIDGET(mainwin_stime_sec)); | 811 gtk_widget_hide(mainwin_stime_sec); |
812 } | 812 } |
813 | 813 |
814 /* window size, mainwinWidth && mainwinHeight properties */ | 814 /* window size, mainwinWidth && mainwinHeight properties */ |
815 if (bmp_active_skin->properties.mainwin_height && bmp_active_skin->properties.mainwin_width) | 815 if (bmp_active_skin->properties.mainwin_height && bmp_active_skin->properties.mainwin_width) |
816 { | 816 { |
856 bitrate /= 1000; | 856 bitrate /= 1000; |
857 | 857 |
858 if (bitrate < 1000) { | 858 if (bitrate < 1000) { |
859 /* Show bitrate in 1000s */ | 859 /* Show bitrate in 1000s */ |
860 g_snprintf(text, sizeof(text), "%3d", bitrate); | 860 g_snprintf(text, sizeof(text), "%3d", bitrate); |
861 textbox_set_text(mainwin_rate_text, text); | 861 ui_skinned_textbox_set_text(mainwin_rate_text, text); |
862 } | 862 } |
863 else { | 863 else { |
864 /* Show bitrate in 100,000s */ | 864 /* Show bitrate in 100,000s */ |
865 g_snprintf(text, sizeof(text), "%2dH", bitrate / 100); | 865 g_snprintf(text, sizeof(text), "%2dH", bitrate / 100); |
866 textbox_set_text(mainwin_rate_text, text); | 866 ui_skinned_textbox_set_text(mainwin_rate_text, text); |
867 } | 867 } |
868 } | 868 } |
869 else | 869 else |
870 textbox_set_text(mainwin_rate_text, _("VBR")); | 870 ui_skinned_textbox_set_text(mainwin_rate_text, _("VBR")); |
871 | 871 |
872 /* Show sampling frequency in kHz */ | 872 /* Show sampling frequency in kHz */ |
873 g_snprintf(text, sizeof(text), "%2d", frequency / 1000); | 873 g_snprintf(text, sizeof(text), "%2d", frequency / 1000); |
874 textbox_set_text(mainwin_freq_text, text); | 874 ui_skinned_textbox_set_text(mainwin_freq_text, text); |
875 | 875 |
876 monostereo_set_num_channels(mainwin_monostereo, n_channels); | 876 monostereo_set_num_channels(mainwin_monostereo, n_channels); |
877 | 877 |
878 if (cfg.player_shaded) | 878 if (cfg.player_shaded) |
879 { | 879 { |
880 widget_show(WIDGET(mainwin_stime_min)); | 880 gtk_widget_show(mainwin_stime_min); |
881 widget_show(WIDGET(mainwin_stime_sec)); | 881 gtk_widget_show(mainwin_stime_sec); |
882 } | 882 } |
883 | 883 |
884 widget_show(WIDGET(mainwin_minus_num)); | 884 widget_show(WIDGET(mainwin_minus_num)); |
885 widget_show(WIDGET(mainwin_10min_num)); | 885 widget_show(WIDGET(mainwin_10min_num)); |
886 widget_show(WIDGET(mainwin_min_num)); | 886 widget_show(WIDGET(mainwin_min_num)); |
912 else | 912 else |
913 g_snprintf(text, 512, "VBR, %0.1f kHz, %s", | 913 g_snprintf(text, 512, "VBR, %0.1f kHz, %s", |
914 (gfloat) frequency / 1000, | 914 (gfloat) frequency / 1000, |
915 (n_channels > 1) ? _("stereo") : _("mono")); | 915 (n_channels > 1) ? _("stereo") : _("mono")); |
916 | 916 |
917 textbox_set_text(mainwin_othertext, text); | 917 ui_skinned_textbox_set_text(mainwin_othertext, text); |
918 | 918 |
919 widget_hide(WIDGET(mainwin_rate_text)); | 919 gtk_widget_hide(mainwin_rate_text); |
920 widget_hide(WIDGET(mainwin_freq_text)); | 920 gtk_widget_hide(mainwin_freq_text); |
921 widget_hide(WIDGET(mainwin_monostereo)); | 921 widget_hide(WIDGET(mainwin_monostereo)); |
922 | 922 |
923 if (bmp_active_skin->properties.mainwin_othertext_visible) | 923 if (bmp_active_skin->properties.mainwin_othertext_visible) |
924 widget_show(WIDGET(mainwin_othertext)); | 924 gtk_widget_show(mainwin_othertext); |
925 } | 925 } |
926 else | 926 else |
927 { | 927 { |
928 widget_show(WIDGET(mainwin_rate_text)); | 928 gtk_widget_show(mainwin_rate_text); |
929 widget_show(WIDGET(mainwin_freq_text)); | 929 gtk_widget_show(mainwin_freq_text); |
930 widget_show(WIDGET(mainwin_monostereo)); | 930 widget_show(WIDGET(mainwin_monostereo)); |
931 widget_hide(WIDGET(mainwin_othertext)); | 931 gtk_widget_hide(mainwin_othertext); |
932 } | 932 } |
933 | 933 |
934 title = playlist_get_info_text(playlist); | 934 title = playlist_get_info_text(playlist); |
935 mainwin_set_song_title(title); | 935 mainwin_set_song_title(title); |
936 g_free(title); | 936 g_free(title); |
953 | 953 |
954 mainwin_position->hs_pressed = FALSE; | 954 mainwin_position->hs_pressed = FALSE; |
955 mainwin_sposition->hs_pressed = FALSE; | 955 mainwin_sposition->hs_pressed = FALSE; |
956 | 956 |
957 /* clear sampling parameter displays */ | 957 /* clear sampling parameter displays */ |
958 textbox_set_text(mainwin_rate_text, " "); | 958 ui_skinned_textbox_set_text(mainwin_rate_text, " "); |
959 textbox_set_text(mainwin_freq_text, " "); | 959 ui_skinned_textbox_set_text(mainwin_freq_text, " "); |
960 monostereo_set_num_channels(mainwin_monostereo, 0); | 960 monostereo_set_num_channels(mainwin_monostereo, 0); |
961 | 961 |
962 if (mainwin_playstatus != NULL) | 962 if (mainwin_playstatus != NULL) |
963 playstatus_set_status(mainwin_playstatus, STATUS_STOP); | 963 playstatus_set_status(mainwin_playstatus, STATUS_STOP); |
964 | 964 |
967 widget_hide(WIDGET(mainwin_10min_num)); | 967 widget_hide(WIDGET(mainwin_10min_num)); |
968 widget_hide(WIDGET(mainwin_min_num)); | 968 widget_hide(WIDGET(mainwin_min_num)); |
969 widget_hide(WIDGET(mainwin_10sec_num)); | 969 widget_hide(WIDGET(mainwin_10sec_num)); |
970 widget_hide(WIDGET(mainwin_sec_num)); | 970 widget_hide(WIDGET(mainwin_sec_num)); |
971 | 971 |
972 widget_hide(WIDGET(mainwin_stime_min)); | 972 gtk_widget_hide(mainwin_stime_min); |
973 widget_hide(WIDGET(mainwin_stime_sec)); | 973 gtk_widget_hide(mainwin_stime_sec); |
974 | 974 |
975 widget_hide(WIDGET(mainwin_position)); | 975 widget_hide(WIDGET(mainwin_position)); |
976 widget_hide(WIDGET(mainwin_sposition)); | 976 widget_hide(WIDGET(mainwin_sposition)); |
977 | 977 |
978 widget_hide(WIDGET(mainwin_othertext)); | 978 gtk_widget_hide(mainwin_othertext); |
979 | 979 |
980 playlistwin_hide_timer(); | 980 playlistwin_hide_timer(); |
981 draw_main_window(TRUE); | 981 draw_main_window(TRUE); |
982 | 982 |
983 vis_clear(active_vis); | 983 vis_clear(active_vis); |
1178 { | 1178 { |
1179 if (widget_contains(WIDGET(mainwin_minus_num), event->x, event->y) || | 1179 if (widget_contains(WIDGET(mainwin_minus_num), event->x, event->y) || |
1180 widget_contains(WIDGET(mainwin_10min_num), event->x, event->y) || | 1180 widget_contains(WIDGET(mainwin_10min_num), event->x, event->y) || |
1181 widget_contains(WIDGET(mainwin_min_num), event->x, event->y) || | 1181 widget_contains(WIDGET(mainwin_min_num), event->x, event->y) || |
1182 widget_contains(WIDGET(mainwin_10sec_num), event->x, event->y) || | 1182 widget_contains(WIDGET(mainwin_10sec_num), event->x, event->y) || |
1183 widget_contains(WIDGET(mainwin_sec_num), event->x, event->y) || | 1183 widget_contains(WIDGET(mainwin_sec_num), event->x, event->y))// || |
1184 widget_contains(WIDGET(mainwin_stime_min), event->x, event->y) || | 1184 //widget_contains(WIDGET(mainwin_stime_min), event->x, event->y) || |
1185 widget_contains(WIDGET(mainwin_stime_sec), event->x, event->y)) | 1185 //widget_contains(WIDGET(mainwin_stime_sec), event->x, event->y)) |
1186 { | 1186 { |
1187 if (cfg.timer_mode == TIMER_ELAPSED) | 1187 change_timer_mode(); |
1188 set_timer_mode(TIMER_REMAINING); | |
1189 else | |
1190 set_timer_mode(TIMER_ELAPSED); | |
1191 } | 1188 } |
1192 } | 1189 } |
1193 | 1190 |
1194 if (grab) | 1191 if (grab) |
1195 gdk_pointer_grab(mainwin->window, FALSE, | 1192 gdk_pointer_grab(mainwin->window, FALSE, |
1753 time = ((playlist_get_current_length(playlist) / 1000) * pos) / 12; | 1750 time = ((playlist_get_current_length(playlist) / 1000) * pos) / 12; |
1754 | 1751 |
1755 if (cfg.timer_mode == TIMER_REMAINING) { | 1752 if (cfg.timer_mode == TIMER_REMAINING) { |
1756 time = (playlist_get_current_length(playlist) / 1000) - time; | 1753 time = (playlist_get_current_length(playlist) / 1000) - time; |
1757 time_msg = g_strdup_printf("-%2.2d", time / 60); | 1754 time_msg = g_strdup_printf("-%2.2d", time / 60); |
1758 textbox_set_text(mainwin_stime_min, time_msg); | 1755 ui_skinned_textbox_set_text(mainwin_stime_min, time_msg); |
1759 g_free(time_msg); | 1756 g_free(time_msg); |
1760 } | 1757 } |
1761 else { | 1758 else { |
1762 time_msg = g_strdup_printf(" %2.2d", time / 60); | 1759 time_msg = g_strdup_printf(" %2.2d", time / 60); |
1763 textbox_set_text(mainwin_stime_min, time_msg); | 1760 ui_skinned_textbox_set_text(mainwin_stime_min, time_msg); |
1764 g_free(time_msg); | 1761 g_free(time_msg); |
1765 } | 1762 } |
1766 | 1763 |
1767 time_msg = g_strdup_printf("%2.2d", time % 60); | 1764 time_msg = g_strdup_printf("%2.2d", time % 60); |
1768 textbox_set_text(mainwin_stime_sec, time_msg); | 1765 ui_skinned_textbox_set_text(mainwin_stime_sec, time_msg); |
1769 g_free(time_msg); | 1766 g_free(time_msg); |
1770 } | 1767 } |
1771 | 1768 |
1772 void | 1769 void |
1773 mainwin_spos_release_cb(gint pos) | 1770 mainwin_spos_release_cb(gint pos) |
2527 set_timer_mode_menu_cb(TimerMode mode) | 2524 set_timer_mode_menu_cb(TimerMode mode) |
2528 { | 2525 { |
2529 cfg.timer_mode = mode; | 2526 cfg.timer_mode = mode; |
2530 } | 2527 } |
2531 | 2528 |
2529 void change_timer_mode(void) { | |
2530 if (cfg.timer_mode == TIMER_ELAPSED) | |
2531 set_timer_mode(TIMER_REMAINING); | |
2532 else | |
2533 set_timer_mode(TIMER_ELAPSED); | |
2534 } | |
2535 | |
2532 static void | 2536 static void |
2533 mainwin_playlist_prev(void) | 2537 mainwin_playlist_prev(void) |
2534 { | 2538 { |
2535 playlist_prev(playlist_get_active()); | 2539 playlist_prev(playlist_get_active()); |
2536 } | 2540 } |
2839 ui_skinned_textbox_set_scroll(mainwin_info, cfg.autoscroll); | 2843 ui_skinned_textbox_set_scroll(mainwin_info, cfg.autoscroll); |
2840 ui_skinned_textbox_set_xfont(mainwin_info, cfg.mainwin_use_xfont, cfg.mainwin_font); | 2844 ui_skinned_textbox_set_xfont(mainwin_info, cfg.mainwin_use_xfont, cfg.mainwin_font); |
2841 g_signal_connect(mainwin_info, "double-clicked", mainwin_info_double_clicked_cb, NULL); | 2845 g_signal_connect(mainwin_info, "double-clicked", mainwin_info_double_clicked_cb, NULL); |
2842 g_signal_connect(mainwin_info, "right-clicked", mainwin_info_right_clicked_cb, NULL); | 2846 g_signal_connect(mainwin_info, "right-clicked", mainwin_info_right_clicked_cb, NULL); |
2843 | 2847 |
2844 mainwin_othertext = | 2848 mainwin_othertext = ui_skinned_textbox_new(); |
2845 create_textbox(&mainwin_wlist, mainwin_bg, SKINNED_WINDOW(mainwin)->gc, 112, 43, | 2849 ui_skinned_textbox_setup(mainwin_othertext, SKINNED_WINDOW(mainwin)->fixed, mainwin_bg, SKINNED_WINDOW(mainwin)->gc, 112, 43, |
2846 153, 1, SKIN_TEXT); | 2850 153, 1, SKIN_TEXT); |
2847 | 2851 |
2848 mainwin_rate_text = | 2852 mainwin_rate_text = ui_skinned_textbox_new(); |
2849 create_textbox(&mainwin_wlist, mainwin_bg, SKINNED_WINDOW(mainwin)->gc, 111, 43, 15, | 2853 ui_skinned_textbox_setup(mainwin_rate_text, SKINNED_WINDOW(mainwin)->fixed, mainwin_bg, SKINNED_WINDOW(mainwin)->gc, 111, 43, 15, |
2850 0, SKIN_TEXT); | 2854 0, SKIN_TEXT); |
2851 mainwin_freq_text = | 2855 |
2852 create_textbox(&mainwin_wlist, mainwin_bg, SKINNED_WINDOW(mainwin)->gc, 156, 43, 10, | 2856 mainwin_freq_text = ui_skinned_textbox_new(); |
2857 ui_skinned_textbox_setup(mainwin_freq_text, SKINNED_WINDOW(mainwin)->fixed, mainwin_bg, SKINNED_WINDOW(mainwin)->gc, 156, 43, 10, | |
2853 0, SKIN_TEXT); | 2858 0, SKIN_TEXT); |
2854 | 2859 |
2855 mainwin_menurow = | 2860 mainwin_menurow = |
2856 create_menurow(&mainwin_wlist, mainwin_bg, SKINNED_WINDOW(mainwin)->gc, 10, 22, 304, | 2861 create_menurow(&mainwin_wlist, mainwin_bg, SKINNED_WINDOW(mainwin)->gc, 10, 22, 304, |
2857 0, 304, 44, mainwin_mr_change, mainwin_mr_release, | 2862 0, 304, 44, mainwin_mr_change, mainwin_mr_release, |
2924 7, 17, 36, 17, 36, 3, 7, 36, 0, 1, 13, | 2929 7, 17, 36, 17, 36, 3, 7, 36, 0, 1, 13, |
2925 mainwin_spos_frame_cb, mainwin_spos_motion_cb, | 2930 mainwin_spos_frame_cb, mainwin_spos_motion_cb, |
2926 mainwin_spos_release_cb, SKIN_TITLEBAR); | 2931 mainwin_spos_release_cb, SKIN_TITLEBAR); |
2927 widget_hide(WIDGET(mainwin_sposition)); | 2932 widget_hide(WIDGET(mainwin_sposition)); |
2928 | 2933 |
2929 mainwin_stime_min = | 2934 mainwin_stime_min = ui_skinned_textbox_new(); |
2930 create_textbox(&mainwin_wlist, mainwin_bg, SKINNED_WINDOW(mainwin)->gc, 130, 4, 15, | 2935 ui_skinned_textbox_setup(mainwin_stime_min, SKINNED_WINDOW(mainwin)->fixed, mainwin_bg, SKINNED_WINDOW(mainwin)->gc, 130, 4, 15, |
2931 FALSE, SKIN_TEXT); | 2936 FALSE, SKIN_TEXT); |
2932 mainwin_stime_sec = | 2937 g_signal_connect(mainwin_stime_min, "clicked", change_timer_mode, NULL); |
2933 create_textbox(&mainwin_wlist, mainwin_bg, SKINNED_WINDOW(mainwin)->gc, 147, 4, 10, | 2938 |
2939 mainwin_stime_sec = ui_skinned_textbox_new(); | |
2940 ui_skinned_textbox_setup(mainwin_stime_sec, SKINNED_WINDOW(mainwin)->fixed, mainwin_bg, SKINNED_WINDOW(mainwin)->gc, 147, 4, 10, | |
2934 FALSE, SKIN_TEXT); | 2941 FALSE, SKIN_TEXT); |
2942 g_signal_connect(mainwin_stime_sec, "clicked", change_timer_mode, NULL); | |
2935 | 2943 |
2936 err = gtk_message_dialog_new(GTK_WINDOW(mainwin), GTK_DIALOG_DESTROY_WITH_PARENT|GTK_DIALOG_MODAL, | 2944 err = gtk_message_dialog_new(GTK_WINDOW(mainwin), GTK_DIALOG_DESTROY_WITH_PARENT|GTK_DIALOG_MODAL, |
2937 GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, _("Error in Audacious.")); | 2945 GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, _("Error in Audacious.")); |
2938 | 2946 |
2939 | 2947 |
2941 /* Dang well better set an error message or you'll see this */ | 2949 /* Dang well better set an error message or you'll see this */ |
2942 gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(err), | 2950 gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(err), |
2943 "Boo! Bad stuff! Booga Booga!"); | 2951 "Boo! Bad stuff! Booga Booga!"); |
2944 | 2952 |
2945 /* XXX: eventually update widgetcore API to not need this */ | 2953 /* XXX: eventually update widgetcore API to not need this */ |
2946 | |
2947 ui_skinned_window_widgetlist_associate(mainwin, WIDGET(mainwin_othertext)); | |
2948 | 2954 |
2949 ui_skinned_window_widgetlist_associate(mainwin, WIDGET(mainwin_rate_text)); | 2955 ui_skinned_window_widgetlist_associate(mainwin, WIDGET(mainwin_rate_text)); |
2950 ui_skinned_window_widgetlist_associate(mainwin, WIDGET(mainwin_freq_text)); | 2956 ui_skinned_window_widgetlist_associate(mainwin, WIDGET(mainwin_freq_text)); |
2951 | 2957 |
2952 ui_skinned_window_widgetlist_associate(mainwin, WIDGET(mainwin_menurow)); | 2958 ui_skinned_window_widgetlist_associate(mainwin, WIDGET(mainwin_menurow)); |
2966 ui_skinned_window_widgetlist_associate(mainwin, WIDGET(mainwin_vis)); | 2972 ui_skinned_window_widgetlist_associate(mainwin, WIDGET(mainwin_vis)); |
2967 ui_skinned_window_widgetlist_associate(mainwin, WIDGET(mainwin_svis)); | 2973 ui_skinned_window_widgetlist_associate(mainwin, WIDGET(mainwin_svis)); |
2968 | 2974 |
2969 ui_skinned_window_widgetlist_associate(mainwin, WIDGET(mainwin_position)); | 2975 ui_skinned_window_widgetlist_associate(mainwin, WIDGET(mainwin_position)); |
2970 ui_skinned_window_widgetlist_associate(mainwin, WIDGET(mainwin_sposition)); | 2976 ui_skinned_window_widgetlist_associate(mainwin, WIDGET(mainwin_sposition)); |
2971 | |
2972 ui_skinned_window_widgetlist_associate(mainwin, WIDGET(mainwin_stime_min)); | |
2973 ui_skinned_window_widgetlist_associate(mainwin, WIDGET(mainwin_stime_sec)); | |
2974 } | 2977 } |
2975 | 2978 |
2976 static void | 2979 static void |
2977 mainwin_create_window(void) | 2980 mainwin_create_window(void) |
2978 { | 2981 { |
3092 | 3095 |
3093 if (!mainwin_sposition->hs_pressed) { | 3096 if (!mainwin_sposition->hs_pressed) { |
3094 gchar *time_str; | 3097 gchar *time_str; |
3095 | 3098 |
3096 time_str = g_strdup_printf("%c%2.2d", stime_prefix, t / 60); | 3099 time_str = g_strdup_printf("%c%2.2d", stime_prefix, t / 60); |
3097 textbox_set_text(mainwin_stime_min, time_str); | 3100 ui_skinned_textbox_set_text(mainwin_stime_min, time_str); |
3098 g_free(time_str); | 3101 g_free(time_str); |
3099 | 3102 |
3100 time_str = g_strdup_printf("%2.2d", t % 60); | 3103 time_str = g_strdup_printf("%2.2d", t % 60); |
3101 textbox_set_text(mainwin_stime_sec, time_str); | 3104 ui_skinned_textbox_set_text(mainwin_stime_sec, time_str); |
3102 g_free(time_str); | 3105 g_free(time_str); |
3103 } | 3106 } |
3104 | 3107 |
3105 time /= 1000; | 3108 time /= 1000; |
3106 length /= 1000; | 3109 length /= 1000; |