Added next preset scales and shortcuts for zoom

This partially resolves Bug 1032
(cherry picked from commit b929f2e6f6)
v3.5.13-sru
Slávek Banko 12 years ago
parent 4a70f9ee1c
commit ab7a4fc222

@ -116,6 +116,8 @@ private slots:
void zoom50 ();
void zoom100 ();
void zoom150 ();
void zoom200 ();
void zoom300 ();
void editMode ();
void syncEditMode ();
void broadcastClicked ();

@ -316,6 +316,10 @@ KDE_NO_CDTOR_EXPORT KMPlayerPart::KMPlayerPart (TQWidget * wparent, const char *
this, TQT_SLOT (setMenuZoom (int)));
panel->zoomMenu ()->connectItem (KMPlayer::ControlPanel::menu_zoom150,
this, TQT_SLOT (setMenuZoom (int)));
panel->zoomMenu ()->connectItem (KMPlayer::ControlPanel::menu_zoom200,
this, TQT_SLOT (setMenuZoom (int)));
panel->zoomMenu ()->connectItem (KMPlayer::ControlPanel::menu_zoom300,
this, TQT_SLOT (setMenuZoom (int)));
m_view->setNoInfoMessages (m_features != Feat_InfoPanel);
if (m_features == Feat_InfoPanel)
@ -619,7 +623,13 @@ KDE_NO_EXPORT void KMPlayerPart::setMenuZoom (int id) {
m_liveconnectextension->setSize (w, h);
return;
}
float scale = 1.5;
float scale = 1;
if (id == KMPlayer::ControlPanel::menu_zoom300)
scale = 3.0;
if (id == KMPlayer::ControlPanel::menu_zoom200)
scale = 2.0;
if (id == KMPlayer::ControlPanel::menu_zoom150)
scale = 1.5;
if (id == KMPlayer::ControlPanel::menu_zoom50)
scale = 0.5;
if (m_view->viewer ())

@ -596,6 +596,8 @@ KDE_NO_EXPORT void KMPlayerApp::initActions () {
new KAction (i18n ("50%"), 0, 0, TQT_TQOBJECT(this), TQT_SLOT (zoom50 ()), ac, "view_zoom_50");
new KAction (i18n ("100%"), TQString ("viewmagfit"), KShortcut (), TQT_TQOBJECT(this), TQT_SLOT (zoom100 ()), ac, "view_zoom_100");
new KAction (i18n ("150%"), 0, 0, TQT_TQOBJECT(this), TQT_SLOT (zoom150 ()), ac, "view_zoom_150");
new KAction (i18n ("200%"), 0, KShortcut (), TQT_TQOBJECT(this), TQT_SLOT (zoom200 ()), ac, "view_zoom_200");
new KAction (i18n ("300%"), 0, KShortcut (), TQT_TQOBJECT(this), TQT_SLOT (zoom300 ()), ac, "view_zoom_300");
viewEditMode = new KToggleAction (i18n ("&Edit mode"), 0, 0, TQT_TQOBJECT(this), TQT_SLOT (editMode ()), ac, "edit_mode");
viewSyncEditMode = new KAction (i18n ("Sync &with playlist"), TQString ("reload"), KShortcut (), TQT_TQOBJECT(this), TQT_SLOT (syncEditMode ()), ac, "sync_edit_mode");
viewSyncEditMode->setEnabled (false);
@ -681,6 +683,10 @@ KDE_NO_EXPORT void KMPlayerApp::initView () {
TQT_TQOBJECT(this), TQT_SLOT (zoom100 ()));
m_view->controlPanel ()->zoomMenu ()->connectItem (KMPlayer::ControlPanel::menu_zoom150,
TQT_TQOBJECT(this), TQT_SLOT (zoom150 ()));
m_view->controlPanel ()->zoomMenu ()->connectItem (KMPlayer::ControlPanel::menu_zoom200,
TQT_TQOBJECT(this), TQT_SLOT (zoom200 ()));
m_view->controlPanel ()->zoomMenu ()->connectItem (KMPlayer::ControlPanel::menu_zoom300,
TQT_TQOBJECT(this), TQT_SLOT (zoom300 ()));
connect (m_view->controlPanel()->broadcastButton (), TQT_SIGNAL (clicked ()),
TQT_TQOBJECT(this), TQT_SLOT (broadcastClicked ()));
m_auto_resize = m_player->settings ()->autoresize;
@ -1075,6 +1081,14 @@ KDE_NO_EXPORT void KMPlayerApp::zoom150 () {
resizePlayer (150);
}
KDE_NO_EXPORT void KMPlayerApp::zoom200 () {
resizePlayer (200);
}
KDE_NO_EXPORT void KMPlayerApp::zoom300 () {
resizePlayer (300);
}
KDE_NO_EXPORT void KMPlayerApp::editMode () {
m_view->docArea ()->hide ();
bool editmode = !m_view->editMode ();

@ -393,6 +393,8 @@ KDE_NO_CDTOR_EXPORT ControlPanel::ControlPanel(TQWidget * parent, View * view)
m_zoomMenu->insertItem (i18n ("50%"), menu_zoom50);
m_zoomMenu->insertItem (i18n ("100%"), menu_zoom100);
m_zoomMenu->insertItem (i18n ("150%"), menu_zoom150);
m_zoomMenu->insertItem (i18n ("200%"), menu_zoom200);
m_zoomMenu->insertItem (i18n ("300%"), menu_zoom300);
m_popupMenu->insertItem (KGlobal::iconLoader ()->loadIconSet (TQString ("viewmag"), KIcon::Small, 0, false), i18n ("&Zoom"), m_zoomMenu, menu_zoom);
m_popupMenu->insertSeparator ();
m_colorMenu = new KMPlayerPopupMenu (this);

@ -100,7 +100,8 @@ class KMPLAYER_EXPORT ControlPanel : public TQWidget {
public:
enum MenuID {
menu_config = 0, menu_player, menu_fullscreen, menu_volume,
menu_bookmark, menu_zoom, menu_zoom50, menu_zoom100, menu_zoom150,
menu_bookmark, menu_zoom, menu_zoom50, menu_zoom100,
menu_zoom150, menu_zoom200, menu_zoom300,
menu_view, menu_video, menu_playlist, menu_minimal
};
enum Button {

@ -34,6 +34,8 @@
<Action name="view_zoom_50"/>
<Action name="view_zoom_100"/>
<Action name="view_zoom_150"/>
<Action name="view_zoom_200"/>
<Action name="view_zoom_300"/>
</Menu>
<Action name="view_keep_ratio"/>
<Separator />
@ -73,6 +75,9 @@
<Action shortcut="F2" name="edit_playlist_item"/>
<Action shortcut="C" name="view_arts_control" />
<Action shortcut="M" name="view_minimal" />
<Action shortcut="Alt+1" name="view_zoom_100" />
<Action shortcut="Alt+2" name="view_zoom_200" />
<Action shortcut="Alt+3" name="view_zoom_300" />
</ActionProperties>
<ToolBar name="mainToolBar"><text></text>
<Action name="new_window"/>

Loading…
Cancel
Save