1
- /*
1
+ /*
2
2
* (c) 2017, Deepin Technology Co., Ltd. <support@deepin.org>
3
3
*
4
4
* This program is free software; you can redistribute it and/or
@@ -148,7 +148,7 @@ static QWidget *createSelectableLineEditOptionHandle(QObject *opt)
148
148
validate (newStr);
149
149
});
150
150
151
- option->connect (option, &DTK_CORE_NAMESPACE::DSettingsOption::valueChanged, le,
151
+ option->connect (option, &DTK_CORE_NAMESPACE::DSettingsOption::valueChanged, le,
152
152
[ = ](const QVariant & value) {
153
153
le->setText (value.toString ());
154
154
le->update ();
@@ -203,7 +203,7 @@ class MainWindowFocusMonitor: public QAbstractNativeEventFilter {
203
203
204
204
class MainWindowPropertyMonitor : public QAbstractNativeEventFilter {
205
205
public:
206
- MainWindowPropertyMonitor (MainWindow *src)
206
+ MainWindowPropertyMonitor (MainWindow *src)
207
207
:QAbstractNativeEventFilter(), _mw(src), _source(src->windowHandle ()) {
208
208
qApp->installNativeEventFilter (this );
209
209
@@ -253,7 +253,7 @@ class MainWindowEventListener : public QObject
253
253
{
254
254
}
255
255
256
- void setEnabled (bool v)
256
+ void setEnabled (bool v)
257
257
{
258
258
enabled = v;
259
259
}
@@ -269,7 +269,7 @@ class MainWindowEventListener : public QObject
269
269
QMouseEvent *e = static_cast <QMouseEvent*>(event);
270
270
setLeftButtonPressed (true );
271
271
auto mw = static_cast <MainWindow*>(parent ());
272
- if (mw->insideResizeArea (e->globalPos ()) && lastCornerEdge != Utility::NoneEdge)
272
+ if (mw->insideResizeArea (e->globalPos ()) && lastCornerEdge != Utility::NoneEdge)
273
273
startResizing = true ;
274
274
275
275
mw->capturedMousePressEvent (e);
@@ -376,7 +376,7 @@ class MainWindowEventListener : public QObject
376
376
return true ;
377
377
}
378
378
}
379
-
379
+
380
380
break ;
381
381
}
382
382
@@ -506,7 +506,7 @@ class MainWindowEventListener : public QObject
506
506
#define SHADOW_COLOR_ACTIVE QColor (0 , 0 , 0 , 255 * 0.6 )
507
507
#endif
508
508
509
- MainWindow::MainWindow (QWidget *parent)
509
+ MainWindow::MainWindow (QWidget *parent)
510
510
: QFrame(NULL )
511
511
{
512
512
bool composited = CompositingManager::get ().composited ();
@@ -525,7 +525,7 @@ MainWindow::MainWindow(QWidget *parent)
525
525
526
526
DThemeManager::instance ()->registerWidget (this );
527
527
setFrameShape (QFrame::NoFrame);
528
-
528
+
529
529
#ifdef USE_DXCB
530
530
if (DApplication::isDXcbPlatform ()) {
531
531
_handle = new DPlatformWindowHandle (this , this );
@@ -584,14 +584,14 @@ MainWindow::MainWindow(QWidget *parent)
584
584
});
585
585
});
586
586
587
- connect (ActionFactory::get ().mainContextMenu (), &QMenu::triggered,
587
+ connect (ActionFactory::get ().mainContextMenu (), &QMenu::triggered,
588
588
this , &MainWindow::menuItemInvoked);
589
- connect (ActionFactory::get ().playlistContextMenu (), &QMenu::triggered,
589
+ connect (ActionFactory::get ().playlistContextMenu (), &QMenu::triggered,
590
590
this , &MainWindow::menuItemInvoked);
591
591
connect (qApp, &QGuiApplication::focusWindowChanged, [=]() {
592
592
if (qApp->focusWindow () != windowHandle ())
593
593
suspendToolsWindow ();
594
- else
594
+ else
595
595
resumeToolsWindow ();
596
596
});
597
597
@@ -647,8 +647,8 @@ MainWindow::MainWindow(QWidget *parent)
647
647
_miniPlayBtn->setVisible (_miniMode);
648
648
_miniCloseBtn->setVisible (_miniMode);
649
649
_miniQuitMiniBtn->setVisible (_miniMode);
650
- // ~
651
-
650
+ // ~
651
+
652
652
updateProxyGeometry ();
653
653
654
654
connect (&ShortcutManager::get (), &ShortcutManager::bindingsChanged,
@@ -704,7 +704,7 @@ MainWindow::MainWindow(QWidget *parent)
704
704
connect (&_delayedMouseReleaseTimer, &QTimer::timeout, this , &MainWindow::delayedMouseReleaseHandler);
705
705
_delayedMouseReleaseTimer.setSingleShot (true );
706
706
707
- _nwComm = new NotificationWidget (this );
707
+ _nwComm = new NotificationWidget (this );
708
708
_nwComm->setFixedHeight (30 );
709
709
_nwComm->setAnchor (NotificationWidget::AnchorNorthWest);
710
710
_nwComm->setAnchorPoint (QPoint (30 , 38 ));
@@ -782,7 +782,7 @@ void MainWindow::setupTitlebar()
782
782
p.drawPixmap ((w2-w)/2 , (w2-w)/2 , logo);
783
783
p.end ();
784
784
_titlebar->setIcon (pm);
785
- _titlebar->setTitle (tr ( " Deepin Movie " ));
785
+ _titlebar->setTitle (QString ( ));
786
786
}
787
787
788
788
{
@@ -810,7 +810,7 @@ void MainWindow::updateContentGeometry(const QRect& rect)
810
810
xcb_configure_window (QX11Info::connection (),
811
811
windowHandle ()->winId (),
812
812
XCB_CONFIG_WINDOW_WIDTH | XCB_CONFIG_WINDOW_HEIGHT |
813
- XCB_CONFIG_WINDOW_Y | XCB_CONFIG_WINDOW_X,
813
+ XCB_CONFIG_WINDOW_Y | XCB_CONFIG_WINDOW_X,
814
814
values);
815
815
816
816
#else
@@ -838,15 +838,15 @@ bool MainWindow::event(QEvent *ev)
838
838
_lastWindowState = wse->oldState ();
839
839
qDebug () << " ------------ _lastWindowState" << _lastWindowState
840
840
<< " current " << windowState ();
841
- // NOTE: windowStateChanged won't be emitted if by draggint to restore. so we need to
841
+ // NOTE: windowStateChanged won't be emitted if by draggint to restore. so we need to
842
842
// check window state here.
843
843
// connect(windowHandle(), &QWindow::windowStateChanged, this, &MainWindow::onWindowStateChanged);
844
844
onWindowStateChanged ();
845
845
}
846
846
return QFrame::event (ev);
847
847
}
848
848
849
-
849
+
850
850
void MainWindow::onWindowStateChanged ()
851
851
{
852
852
qDebug () << windowState ();
@@ -1111,8 +1111,8 @@ void MainWindow::onBindingsChanged()
1111
1111
auto actions = scmgr.actionsForBindings ();
1112
1112
for (auto * act: actions) {
1113
1113
this ->addAction (act);
1114
- connect (act, &QAction::triggered, [=]() {
1115
- this ->menuItemInvoked (act);
1114
+ connect (act, &QAction::triggered, [=]() {
1115
+ this ->menuItemInvoked (act);
1116
1116
});
1117
1117
}
1118
1118
}
@@ -1189,7 +1189,7 @@ void MainWindow::reflectActionToUI(ActionFactory::ActionKind kd)
1189
1189
auto old = (*p)->isEnabled ();
1190
1190
(*p)->setEnabled (false );
1191
1191
if (kd == ActionFactory::TogglePlaylist) {
1192
- // here what we read is the last state of playlist
1192
+ // here what we read is the last state of playlist
1193
1193
(*p)->setChecked (_playlist->state () != PlaylistWidget::Opened);
1194
1194
} else {
1195
1195
(*p)->setChecked (!(*p)->isChecked ());
@@ -1376,7 +1376,7 @@ void MainWindow::requestAction(ActionFactory::ActionKind kd, bool fromUI,
1376
1376
1377
1377
switch (kd) {
1378
1378
case ActionFactory::ActionKind::Exit:
1379
- qApp->quit ();
1379
+ qApp->quit ();
1380
1380
break ;
1381
1381
1382
1382
case ActionFactory::ActionKind::LightTheme:
@@ -1433,7 +1433,7 @@ void MainWindow::requestAction(ActionFactory::ActionKind kd, bool fromUI,
1433
1433
QDir::currentPath (),
1434
1434
tr (" All videos (%1)" ).arg (_engine->video_filetypes .join (" " )), 0 ,
1435
1435
QFileDialog::HideNameFilterDetails);
1436
-
1436
+
1437
1437
QList<QUrl> urls;
1438
1438
if (filenames.size ()) {
1439
1439
for (const auto & filename: filenames) {
@@ -1505,7 +1505,7 @@ void MainWindow::requestAction(ActionFactory::ActionKind kd, bool fromUI,
1505
1505
1506
1506
case ActionFactory::ActionKind::WindowAbove:
1507
1507
_windowAbove = !_windowAbove;
1508
- /* *
1508
+ /* *
1509
1509
* switch above state by change windowFlags is unacceptable, since it'll
1510
1510
* toggle visibility of window.
1511
1511
* ```
@@ -1661,7 +1661,7 @@ void MainWindow::requestAction(ActionFactory::ActionKind kd, bool fromUI,
1661
1661
if (_engine->muted ()) {
1662
1662
_engine->toggleMute ();
1663
1663
}
1664
- _engine->changeVolume (args[0 ].toInt ());
1664
+ _engine->changeVolume (args[0 ].toInt ());
1665
1665
Settings::get ().setInternalOption (" global_volume" , qMin (_engine->volume (), 100 ));
1666
1666
double pert = _engine->volume ();
1667
1667
_nwComm->updateWithMessage (tr (" Volume: %1%" ).arg (pert));
@@ -1832,7 +1832,7 @@ void MainWindow::requestAction(ActionFactory::ActionKind kd, bool fromUI,
1832
1832
1833
1833
QString filePath = Settings::get ().screenshotNameTemplate ();
1834
1834
bool success = false ;
1835
- if (img.isNull ())
1835
+ if (img.isNull ())
1836
1836
qDebug ()<< __func__ << " pixmap is null" ;
1837
1837
else
1838
1838
success = img.save (filePath);
@@ -1866,7 +1866,7 @@ void MainWindow::requestAction(ActionFactory::ActionKind kd, bool fromUI,
1866
1866
#else
1867
1867
1868
1868
if (!_nwShot) {
1869
- _nwShot = new NotificationWidget (this );
1869
+ _nwShot = new NotificationWidget (this );
1870
1870
_nwShot->setAnchor (NotificationWidget::AnchorNorthWest);
1871
1871
_nwShot->setAnchorPoint (QPoint (30 , 38 ));
1872
1872
}
@@ -1949,7 +1949,7 @@ void MainWindow::onBurstScreenshot(const QImage& frame, qint64 timestamp)
1949
1949
if (ret == QDialog::Accepted) {
1950
1950
auto poster_path = bsd.savedPosterPath ();
1951
1951
if (!_nwShot) {
1952
- _nwShot = new NotificationWidget (this );
1952
+ _nwShot = new NotificationWidget (this );
1953
1953
_nwShot->setAnchor (NotificationWidget::AnchorNorthWest);
1954
1954
_nwShot->setAnchorPoint (QPoint (30 , 38 ));
1955
1955
}
@@ -2033,7 +2033,7 @@ void MainWindow::playList(const QList<QString>& l)
2033
2033
2034
2034
void MainWindow::play (const QUrl& url)
2035
2035
{
2036
- if (!url.isValid ())
2036
+ if (!url.isValid ())
2037
2037
return ;
2038
2038
2039
2039
if (!isHidden ()) {
@@ -2094,7 +2094,7 @@ void MainWindow::updateProxyGeometry()
2094
2094
}
2095
2095
2096
2096
if (_toolbox) {
2097
- QRect r (view_rect.left (), height () - TOOLBOX_HEIGHT_EXT - view_rect.top (),
2097
+ QRect r (view_rect.left (), height () - TOOLBOX_HEIGHT_EXT - view_rect.top (),
2098
2098
view_rect.width (), TOOLBOX_HEIGHT_EXT);
2099
2099
if (isFullScreen ()) {
2100
2100
r.moveTopLeft ({0 , height () - TOOLBOX_HEIGHT_EXT});
@@ -2180,10 +2180,10 @@ void MainWindow::suspendToolsWindow()
2180
2180
2181
2181
void MainWindow::resumeToolsWindow ()
2182
2182
{
2183
- if (_engine->state () != PlayerEngine::Idle &&
2183
+ if (_engine->state () != PlayerEngine::Idle &&
2184
2184
qApp->applicationState () == Qt::ApplicationActive) {
2185
2185
// playlist's previous state was Opened
2186
- if (_playlist->state () != PlaylistWidget::Closed &&
2186
+ if (_playlist->state () != PlaylistWidget::Closed &&
2187
2187
!frameGeometry ().contains (QCursor::pos ())) {
2188
2188
goto _finish;
2189
2189
}
@@ -2223,7 +2223,7 @@ void MainWindow::closeEvent(QCloseEvent *ev)
2223
2223
qDebug () << " uninhibit cookie" << _lastCookie;
2224
2224
_lastCookie = 0 ;
2225
2225
}
2226
-
2226
+
2227
2227
int cur = 0 ;
2228
2228
if (Settings::get ().isSet (Settings::ResumeFromLast)) {
2229
2229
cur = _engine->playlist ().current ();
@@ -2239,7 +2239,7 @@ void MainWindow::closeEvent(QCloseEvent *ev)
2239
2239
2240
2240
void MainWindow::wheelEvent (QWheelEvent* we)
2241
2241
{
2242
- if (insideToolsArea (we->pos ()) || insideResizeArea (we->globalPos ()))
2242
+ if (insideToolsArea (we->pos ()) || insideResizeArea (we->globalPos ()))
2243
2243
return ;
2244
2244
2245
2245
if (_playlist->state () == PlaylistWidget::Opened) {
@@ -2278,10 +2278,10 @@ void MainWindow::showEvent(QShowEvent *event)
2278
2278
}
2279
2279
}
2280
2280
2281
- void MainWindow::resizeByConstraints (bool forceCentered)
2281
+ void MainWindow::resizeByConstraints (bool forceCentered)
2282
2282
{
2283
2283
if (_engine->state () == PlayerEngine::Idle || _engine->playlist ().count () == 0 ) {
2284
- _titlebar->setTitle (tr ( " Deepin Movie " ));
2284
+ _titlebar->setTitle (QString ( ));
2285
2285
return ;
2286
2286
}
2287
2287
@@ -2305,7 +2305,7 @@ void MainWindow::resizeByConstraints(bool forceCentered)
2305
2305
}
2306
2306
2307
2307
qDebug () << " original: " << size () << " requested: " << sz;
2308
- if (size () == sz)
2308
+ if (size () == sz)
2309
2309
return ;
2310
2310
2311
2311
if (forceCentered) {
@@ -2378,7 +2378,7 @@ void MainWindow::updateWindowTitle()
2378
2378
Qt::ElideMiddle, _titlebar->contentsRect ().width () - 300 );
2379
2379
_titlebar->setTitle (title);
2380
2380
} else {
2381
- _titlebar->setTitle (tr ( " Deepin Movie " ));
2381
+ _titlebar->setTitle (QString ( ));
2382
2382
}
2383
2383
_titlebar->setProperty (" idle" , _engine->state () == PlayerEngine::Idle);
2384
2384
_titlebar->setStyleSheet (styleSheet ());
@@ -2516,7 +2516,7 @@ void MainWindow::mouseMoveEvent(QMouseEvent *ev)
2516
2516
2517
2517
void MainWindow::contextMenuEvent (QContextMenuEvent *cme)
2518
2518
{
2519
- if (_miniMode || _inBurstShootMode)
2519
+ if (_miniMode || _inBurstShootMode)
2520
2520
return ;
2521
2521
2522
2522
if (insideToolsArea (cme->pos ()))
@@ -2564,7 +2564,7 @@ void MainWindow::paintEvent(QPaintEvent* pe)
2564
2564
p.fillPath (pp, QColor (0 , 0 , 0 , light ? 255 * 0.1 : 255 ));
2565
2565
2566
2566
{
2567
- /* we supposed to draw by qss background-color here, but it's conflict with
2567
+ /* we supposed to draw by qss background-color here, but it's conflict with
2568
2568
* border area (border has alpha, which blends with background-color.
2569
2569
*/
2570
2570
auto view_rect = rect ().marginsRemoved (QMargins (1 , 1 , 1 , 1 ));
@@ -2592,7 +2592,7 @@ void MainWindow::toggleUIMode()
2592
2592
2593
2593
if (_miniMode)
2594
2594
_titlebar->setDisableFlags (Qt::WindowMaximizeButtonHint);
2595
- else
2595
+ else
2596
2596
_titlebar->setDisableFlags (0 );
2597
2597
2598
2598
if (_listener) _listener->setEnabled (!_miniMode);
@@ -2655,9 +2655,9 @@ void MainWindow::toggleUIMode()
2655
2655
setGeometry (geom);
2656
2656
2657
2657
_miniQuitMiniBtn->move (sz.width () - 14 - _miniQuitMiniBtn->width (),
2658
- sz.height () - 10 - _miniQuitMiniBtn->height ());
2658
+ sz.height () - 10 - _miniQuitMiniBtn->height ());
2659
2659
_miniCloseBtn->move (sz.width () - 4 - _miniCloseBtn->width (), 4 );
2660
- _miniPlayBtn->move (14 , sz.height () - 10 - _miniPlayBtn->height ());
2660
+ _miniPlayBtn->move (14 , sz.height () - 10 - _miniPlayBtn->height ());
2661
2661
2662
2662
} else {
2663
2663
if (_stateBeforeMiniMode & SBEM_Above) {
0 commit comments