Mercurial > audlegacy-plugins
comparison src/skins/ui_main.c @ 3159:1ffcad5f406c
import new skins plugin
author | Yoshiki Yazawa <yaz@honeyplanet.jp> |
---|---|
date | Fri, 22 May 2009 23:18:48 +0900 |
parents | 8b97f9560dc3 |
children |
comparison
equal
deleted
inserted
replaced
3158:8b97f9560dc3 | 3159:1ffcad5f406c |
---|---|
475 | 475 |
476 if (aud_active_skin->properties.mainwin_text_x && aud_active_skin->properties.mainwin_text_y) | 476 if (aud_active_skin->properties.mainwin_text_x && aud_active_skin->properties.mainwin_text_y) |
477 gtk_fixed_move(GTK_FIXED(SKINNED_WINDOW(mainwin)->normal), GTK_WIDGET(mainwin_info), aud_active_skin->properties.mainwin_text_x, | 477 gtk_fixed_move(GTK_FIXED(SKINNED_WINDOW(mainwin)->normal), GTK_WIDGET(mainwin_info), aud_active_skin->properties.mainwin_text_x, |
478 aud_active_skin->properties.mainwin_text_y); | 478 aud_active_skin->properties.mainwin_text_y); |
479 | 479 |
480 | |
481 #if 0 | |
480 if (aud_active_skin->properties.mainwin_text_width) { | 482 if (aud_active_skin->properties.mainwin_text_width) { |
481 UI_SKINNED_TEXTBOX(mainwin_info)->width = aud_active_skin->properties.mainwin_text_width; | 483 UI_SKINNED_TEXTBOX(mainwin_info)->width = aud_active_skin->properties.mainwin_text_width; |
482 gtk_widget_set_size_request (mainwin_info, aud_active_skin->properties. | 484 gtk_widget_set_size_request (mainwin_info, aud_active_skin->properties. |
483 mainwin_text_width * MAINWIN_SCALE_FACTOR, -1); | 485 mainwin_text_width * MAINWIN_SCALE_FACTOR, -1); |
484 } | 486 } |
487 #else | |
488 if (aud_active_skin->properties.mainwin_text_width) | |
489 UI_SKINNED_TEXTBOX(mainwin_info)->width = | |
490 aud_active_skin->properties.mainwin_text_width; | |
491 | |
492 if (aud_active_skin->properties.mainwin_text_height) | |
493 UI_SKINNED_TEXTBOX(mainwin_info)->height = | |
494 aud_active_skin->properties.mainwin_text_height; | |
495 | |
496 gtk_widget_set_size_request (mainwin_info, | |
497 aud_active_skin->properties. | |
498 mainwin_text_width * MAINWIN_SCALE_FACTOR, | |
499 aud_active_skin->properties. | |
500 mainwin_text_height * MAINWIN_SCALE_FACTOR); | |
501 #endif | |
502 | |
503 | |
504 | |
485 | 505 |
486 if (aud_active_skin->properties.mainwin_infobar_x && aud_active_skin->properties.mainwin_infobar_y) | 506 if (aud_active_skin->properties.mainwin_infobar_x && aud_active_skin->properties.mainwin_infobar_y) |
487 gtk_fixed_move(GTK_FIXED(SKINNED_WINDOW(mainwin)->normal), GTK_WIDGET(mainwin_othertext), aud_active_skin->properties.mainwin_infobar_x, | 507 gtk_fixed_move(GTK_FIXED(SKINNED_WINDOW(mainwin)->normal), GTK_WIDGET(mainwin_othertext), aud_active_skin->properties.mainwin_infobar_x, |
488 aud_active_skin->properties.mainwin_infobar_y); | 508 aud_active_skin->properties.mainwin_infobar_y); |
489 | 509 |
1343 } | 1363 } |
1344 | 1364 |
1345 void | 1365 void |
1346 mainwin_pl_pushed(gboolean toggled) | 1366 mainwin_pl_pushed(gboolean toggled) |
1347 { | 1367 { |
1348 if (toggled) | 1368 playlistwin_show (toggled); |
1349 playlistwin_show(); | |
1350 else | |
1351 playlistwin_hide(); | |
1352 } | 1369 } |
1353 | 1370 |
1354 gint | 1371 gint |
1355 mainwin_spos_frame_cb(gint pos) | 1372 mainwin_spos_frame_cb(gint pos) |
1356 { | 1373 { |
1566 mainwin_adjust_balance_motion(b); | 1583 mainwin_adjust_balance_motion(b); |
1567 mainwin_set_balance_slider(b); | 1584 mainwin_set_balance_slider(b); |
1568 equalizerwin_set_balance_slider(b); | 1585 equalizerwin_set_balance_slider(b); |
1569 } | 1586 } |
1570 | 1587 |
1571 void | 1588 static void mainwin_real_show (void) |
1572 mainwin_show(gboolean show) | 1589 { |
1573 { | |
1574 if (show) | |
1575 mainwin_real_show(); | |
1576 else | |
1577 mainwin_real_hide(); | |
1578 } | |
1579 | |
1580 void | |
1581 mainwin_real_show(void) | |
1582 { | |
1583 config.player_visible = TRUE; | |
1584 | |
1585 check_set( toggleaction_group_others , "show player" , TRUE ); | |
1586 | |
1587 if (config.player_shaded) | 1590 if (config.player_shaded) |
1588 ui_vis_clear_data(mainwin_vis); | 1591 ui_vis_clear_data(mainwin_vis); |
1589 | 1592 |
1590 if (config.show_wm_decorations) { | 1593 if (config.show_wm_decorations) { |
1591 if (config.player_x != -1 && config.save_window_position) | 1594 if (config.player_x != -1 && config.save_window_position) |
1600 | 1603 |
1601 mainwin_refresh_hints(); | 1604 mainwin_refresh_hints(); |
1602 gtk_window_present(GTK_WINDOW(mainwin)); | 1605 gtk_window_present(GTK_WINDOW(mainwin)); |
1603 } | 1606 } |
1604 | 1607 |
1605 void | 1608 static void mainwin_real_hide (void) |
1606 mainwin_real_hide(void) | 1609 { |
1607 { | |
1608 | |
1609 check_set( toggleaction_group_others , "show player", FALSE); | |
1610 | |
1611 if (config.player_shaded) | 1610 if (config.player_shaded) |
1612 ui_svis_clear_data(mainwin_svis); | 1611 ui_svis_clear_data(mainwin_svis); |
1613 | 1612 |
1614 gtk_widget_hide(mainwin); | 1613 gtk_widget_hide(mainwin); |
1615 | 1614 } |
1616 config.player_visible = FALSE; | 1615 |
1617 } | 1616 void mainwin_show (gboolean show) |
1618 | 1617 { |
1618 GtkAction * a; | |
1619 | |
1620 a = gtk_action_group_get_action (toggleaction_group_others, "show player"); | |
1621 | |
1622 if (a && gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (a)) != show) | |
1623 gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (a), show); | |
1624 else | |
1625 { | |
1626 config.player_visible = show; | |
1627 aud_cfg->player_visible = show; | |
1628 | |
1629 if (show) | |
1630 mainwin_real_show (); | |
1631 else | |
1632 mainwin_real_hide (); | |
1633 } | |
1634 } | |
1619 | 1635 |
1620 void | 1636 void |
1621 mainwin_set_stopaftersong(gboolean stop) | 1637 mainwin_set_stopaftersong(gboolean stop) |
1622 { | 1638 { |
1623 aud_cfg->stopaftersong = stop; | 1639 aud_cfg->stopaftersong = stop; |
1697 break; | 1713 break; |
1698 case MAINWIN_GENERAL_SHOWMWIN: | 1714 case MAINWIN_GENERAL_SHOWMWIN: |
1699 mainwin_show(GTK_CHECK_MENU_ITEM(item)->active); | 1715 mainwin_show(GTK_CHECK_MENU_ITEM(item)->active); |
1700 break; | 1716 break; |
1701 case MAINWIN_GENERAL_SHOWPLWIN: | 1717 case MAINWIN_GENERAL_SHOWPLWIN: |
1702 if (GTK_CHECK_MENU_ITEM(item)->active) | 1718 playlistwin_show (GTK_CHECK_MENU_ITEM(item) ->active); |
1703 playlistwin_show(); | |
1704 else | |
1705 playlistwin_hide(); | |
1706 break; | 1719 break; |
1707 case MAINWIN_GENERAL_SHOWEQWIN: | 1720 case MAINWIN_GENERAL_SHOWEQWIN: |
1708 if (GTK_CHECK_MENU_ITEM(item)->active) | 1721 equalizerwin_show (GTK_CHECK_MENU_ITEM (item)->active); |
1709 equalizerwin_real_show(); | |
1710 else | |
1711 equalizerwin_real_hide(); | |
1712 break; | 1722 break; |
1713 case MAINWIN_GENERAL_PREV: | 1723 case MAINWIN_GENERAL_PREV: |
1714 aud_playlist_prev(playlist); | 1724 aud_playlist_prev(playlist); |
1715 break; | 1725 break; |
1716 case MAINWIN_GENERAL_PLAY: | 1726 case MAINWIN_GENERAL_PLAY: |
2428 time_str = g_strdup_printf("%2.2d", t % 60); | 2438 time_str = g_strdup_printf("%2.2d", t % 60); |
2429 ui_skinned_textbox_set_text(mainwin_stime_sec, time_str); | 2439 ui_skinned_textbox_set_text(mainwin_stime_sec, time_str); |
2430 g_free(time_str); | 2440 g_free(time_str); |
2431 } | 2441 } |
2432 | 2442 |
2433 time /= 1000; | |
2434 length /= 1000; | |
2435 if (length > 0) { | 2443 if (length > 0) { |
2436 if (time > length) { | 2444 if (time > length) { |
2437 ui_skinned_horizontal_slider_set_position(mainwin_position, 219); | 2445 ui_skinned_horizontal_slider_set_position(mainwin_position, 219); |
2438 ui_skinned_horizontal_slider_set_position(mainwin_sposition, 13); | 2446 ui_skinned_horizontal_slider_set_position(mainwin_sposition, 13); |
2439 } | 2447 } |
2586 } | 2594 } |
2587 | 2595 |
2588 void | 2596 void |
2589 action_show_equalizer( GtkToggleAction * action ) | 2597 action_show_equalizer( GtkToggleAction * action ) |
2590 { | 2598 { |
2591 if (gtk_toggle_action_get_active(action)) | 2599 equalizerwin_show (gtk_toggle_action_get_active (action)); |
2592 equalizerwin_real_show(); | |
2593 else | |
2594 equalizerwin_real_hide(); | |
2595 } | 2600 } |
2596 | 2601 |
2597 void | 2602 void |
2598 action_show_playlist_editor( GtkToggleAction * action ) | 2603 action_show_playlist_editor( GtkToggleAction * action ) |
2599 { | 2604 { |
2600 if (gtk_toggle_action_get_active(action)) | 2605 playlistwin_show (gtk_toggle_action_get_active (action)); |
2601 playlistwin_show(); | |
2602 else | |
2603 playlistwin_hide(); | |
2604 } | 2606 } |
2605 | 2607 |
2606 void | 2608 void |
2607 action_show_player( GtkToggleAction * action ) | 2609 action_show_player( GtkToggleAction * action ) |
2608 { | 2610 { |