Skip to content

Commit 5c290d6

Browse files
committed
fix: remove application name in titlebar
Change-Id: Idfe329e489c1b4fcec1d8be9bfb58c3ca4518166
1 parent 17d3229 commit 5c290d6

File tree

1 file changed

+43
-43
lines changed

1 file changed

+43
-43
lines changed

src/common/mainwindow.cpp

+43-43
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*
1+
/*
22
* (c) 2017, Deepin Technology Co., Ltd. <support@deepin.org>
33
*
44
* This program is free software; you can redistribute it and/or
@@ -148,7 +148,7 @@ static QWidget *createSelectableLineEditOptionHandle(QObject *opt)
148148
validate(newStr);
149149
});
150150

151-
option->connect(option, &DTK_CORE_NAMESPACE::DSettingsOption::valueChanged, le,
151+
option->connect(option, &DTK_CORE_NAMESPACE::DSettingsOption::valueChanged, le,
152152
[ = ](const QVariant & value) {
153153
le->setText(value.toString());
154154
le->update();
@@ -203,7 +203,7 @@ class MainWindowFocusMonitor: public QAbstractNativeEventFilter {
203203

204204
class MainWindowPropertyMonitor: public QAbstractNativeEventFilter {
205205
public:
206-
MainWindowPropertyMonitor(MainWindow *src)
206+
MainWindowPropertyMonitor(MainWindow *src)
207207
:QAbstractNativeEventFilter(), _mw(src), _source(src->windowHandle()) {
208208
qApp->installNativeEventFilter(this);
209209

@@ -253,7 +253,7 @@ class MainWindowEventListener : public QObject
253253
{
254254
}
255255

256-
void setEnabled(bool v)
256+
void setEnabled(bool v)
257257
{
258258
enabled = v;
259259
}
@@ -269,7 +269,7 @@ class MainWindowEventListener : public QObject
269269
QMouseEvent *e = static_cast<QMouseEvent*>(event);
270270
setLeftButtonPressed(true);
271271
auto mw = static_cast<MainWindow*>(parent());
272-
if (mw->insideResizeArea(e->globalPos()) && lastCornerEdge != Utility::NoneEdge)
272+
if (mw->insideResizeArea(e->globalPos()) && lastCornerEdge != Utility::NoneEdge)
273273
startResizing = true;
274274

275275
mw->capturedMousePressEvent(e);
@@ -376,7 +376,7 @@ class MainWindowEventListener : public QObject
376376
return true;
377377
}
378378
}
379-
379+
380380
break;
381381
}
382382

@@ -506,7 +506,7 @@ class MainWindowEventListener : public QObject
506506
#define SHADOW_COLOR_ACTIVE QColor(0, 0, 0, 255 * 0.6)
507507
#endif
508508

509-
MainWindow::MainWindow(QWidget *parent)
509+
MainWindow::MainWindow(QWidget *parent)
510510
: QFrame(NULL)
511511
{
512512
bool composited = CompositingManager::get().composited();
@@ -525,7 +525,7 @@ MainWindow::MainWindow(QWidget *parent)
525525

526526
DThemeManager::instance()->registerWidget(this);
527527
setFrameShape(QFrame::NoFrame);
528-
528+
529529
#ifdef USE_DXCB
530530
if (DApplication::isDXcbPlatform()) {
531531
_handle = new DPlatformWindowHandle(this, this);
@@ -584,14 +584,14 @@ MainWindow::MainWindow(QWidget *parent)
584584
});
585585
});
586586

587-
connect(ActionFactory::get().mainContextMenu(), &QMenu::triggered,
587+
connect(ActionFactory::get().mainContextMenu(), &QMenu::triggered,
588588
this, &MainWindow::menuItemInvoked);
589-
connect(ActionFactory::get().playlistContextMenu(), &QMenu::triggered,
589+
connect(ActionFactory::get().playlistContextMenu(), &QMenu::triggered,
590590
this, &MainWindow::menuItemInvoked);
591591
connect(qApp, &QGuiApplication::focusWindowChanged, [=]() {
592592
if (qApp->focusWindow() != windowHandle())
593593
suspendToolsWindow();
594-
else
594+
else
595595
resumeToolsWindow();
596596
});
597597

@@ -647,8 +647,8 @@ MainWindow::MainWindow(QWidget *parent)
647647
_miniPlayBtn->setVisible(_miniMode);
648648
_miniCloseBtn->setVisible(_miniMode);
649649
_miniQuitMiniBtn->setVisible(_miniMode);
650-
// ~
651-
650+
// ~
651+
652652
updateProxyGeometry();
653653

654654
connect(&ShortcutManager::get(), &ShortcutManager::bindingsChanged,
@@ -704,7 +704,7 @@ MainWindow::MainWindow(QWidget *parent)
704704
connect(&_delayedMouseReleaseTimer, &QTimer::timeout, this, &MainWindow::delayedMouseReleaseHandler);
705705
_delayedMouseReleaseTimer.setSingleShot(true);
706706

707-
_nwComm = new NotificationWidget(this);
707+
_nwComm = new NotificationWidget(this);
708708
_nwComm->setFixedHeight(30);
709709
_nwComm->setAnchor(NotificationWidget::AnchorNorthWest);
710710
_nwComm->setAnchorPoint(QPoint(30, 38));
@@ -782,7 +782,7 @@ void MainWindow::setupTitlebar()
782782
p.drawPixmap((w2-w)/2, (w2-w)/2, logo);
783783
p.end();
784784
_titlebar->setIcon(pm);
785-
_titlebar->setTitle(tr("Deepin Movie"));
785+
_titlebar->setTitle(QString());
786786
}
787787

788788
{
@@ -810,7 +810,7 @@ void MainWindow::updateContentGeometry(const QRect& rect)
810810
xcb_configure_window(QX11Info::connection(),
811811
windowHandle()->winId(),
812812
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,
814814
values);
815815

816816
#else
@@ -838,15 +838,15 @@ bool MainWindow::event(QEvent *ev)
838838
_lastWindowState = wse->oldState();
839839
qDebug() << "------------ _lastWindowState" << _lastWindowState
840840
<< "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
842842
//check window state here.
843843
//connect(windowHandle(), &QWindow::windowStateChanged, this, &MainWindow::onWindowStateChanged);
844844
onWindowStateChanged();
845845
}
846846
return QFrame::event(ev);
847847
}
848848

849-
849+
850850
void MainWindow::onWindowStateChanged()
851851
{
852852
qDebug() << windowState();
@@ -1111,8 +1111,8 @@ void MainWindow::onBindingsChanged()
11111111
auto actions = scmgr.actionsForBindings();
11121112
for (auto* act: actions) {
11131113
this->addAction(act);
1114-
connect(act, &QAction::triggered, [=]() {
1115-
this->menuItemInvoked(act);
1114+
connect(act, &QAction::triggered, [=]() {
1115+
this->menuItemInvoked(act);
11161116
});
11171117
}
11181118
}
@@ -1189,7 +1189,7 @@ void MainWindow::reflectActionToUI(ActionFactory::ActionKind kd)
11891189
auto old = (*p)->isEnabled();
11901190
(*p)->setEnabled(false);
11911191
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
11931193
(*p)->setChecked(_playlist->state() != PlaylistWidget::Opened);
11941194
} else {
11951195
(*p)->setChecked(!(*p)->isChecked());
@@ -1376,7 +1376,7 @@ void MainWindow::requestAction(ActionFactory::ActionKind kd, bool fromUI,
13761376

13771377
switch (kd) {
13781378
case ActionFactory::ActionKind::Exit:
1379-
qApp->quit();
1379+
qApp->quit();
13801380
break;
13811381

13821382
case ActionFactory::ActionKind::LightTheme:
@@ -1433,7 +1433,7 @@ void MainWindow::requestAction(ActionFactory::ActionKind kd, bool fromUI,
14331433
QDir::currentPath(),
14341434
tr("All videos (%1)").arg(_engine->video_filetypes.join(" ")), 0,
14351435
QFileDialog::HideNameFilterDetails);
1436-
1436+
14371437
QList<QUrl> urls;
14381438
if (filenames.size()) {
14391439
for (const auto& filename: filenames) {
@@ -1505,7 +1505,7 @@ void MainWindow::requestAction(ActionFactory::ActionKind kd, bool fromUI,
15051505

15061506
case ActionFactory::ActionKind::WindowAbove:
15071507
_windowAbove = !_windowAbove;
1508-
/**
1508+
/**
15091509
* switch above state by change windowFlags is unacceptable, since it'll
15101510
* toggle visibility of window.
15111511
* ```
@@ -1661,7 +1661,7 @@ void MainWindow::requestAction(ActionFactory::ActionKind kd, bool fromUI,
16611661
if (_engine->muted()) {
16621662
_engine->toggleMute();
16631663
}
1664-
_engine->changeVolume(args[0].toInt());
1664+
_engine->changeVolume(args[0].toInt());
16651665
Settings::get().setInternalOption("global_volume", qMin(_engine->volume(), 100));
16661666
double pert = _engine->volume();
16671667
_nwComm->updateWithMessage(tr("Volume: %1%").arg(pert));
@@ -1832,7 +1832,7 @@ void MainWindow::requestAction(ActionFactory::ActionKind kd, bool fromUI,
18321832

18331833
QString filePath = Settings::get().screenshotNameTemplate();
18341834
bool success = false;
1835-
if (img.isNull())
1835+
if (img.isNull())
18361836
qDebug()<< __func__ << "pixmap is null";
18371837
else
18381838
success = img.save(filePath);
@@ -1866,7 +1866,7 @@ void MainWindow::requestAction(ActionFactory::ActionKind kd, bool fromUI,
18661866
#else
18671867

18681868
if (!_nwShot) {
1869-
_nwShot = new NotificationWidget(this);
1869+
_nwShot = new NotificationWidget(this);
18701870
_nwShot->setAnchor(NotificationWidget::AnchorNorthWest);
18711871
_nwShot->setAnchorPoint(QPoint(30, 38));
18721872
}
@@ -1949,7 +1949,7 @@ void MainWindow::onBurstScreenshot(const QImage& frame, qint64 timestamp)
19491949
if (ret == QDialog::Accepted) {
19501950
auto poster_path = bsd.savedPosterPath();
19511951
if (!_nwShot) {
1952-
_nwShot = new NotificationWidget(this);
1952+
_nwShot = new NotificationWidget(this);
19531953
_nwShot->setAnchor(NotificationWidget::AnchorNorthWest);
19541954
_nwShot->setAnchorPoint(QPoint(30, 38));
19551955
}
@@ -2033,7 +2033,7 @@ void MainWindow::playList(const QList<QString>& l)
20332033

20342034
void MainWindow::play(const QUrl& url)
20352035
{
2036-
if (!url.isValid())
2036+
if (!url.isValid())
20372037
return;
20382038

20392039
if (!isHidden()) {
@@ -2094,7 +2094,7 @@ void MainWindow::updateProxyGeometry()
20942094
}
20952095

20962096
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(),
20982098
view_rect.width(), TOOLBOX_HEIGHT_EXT);
20992099
if (isFullScreen()) {
21002100
r.moveTopLeft({0, height() - TOOLBOX_HEIGHT_EXT});
@@ -2180,10 +2180,10 @@ void MainWindow::suspendToolsWindow()
21802180

21812181
void MainWindow::resumeToolsWindow()
21822182
{
2183-
if (_engine->state() != PlayerEngine::Idle &&
2183+
if (_engine->state() != PlayerEngine::Idle &&
21842184
qApp->applicationState() == Qt::ApplicationActive) {
21852185
// playlist's previous state was Opened
2186-
if (_playlist->state() != PlaylistWidget::Closed &&
2186+
if (_playlist->state() != PlaylistWidget::Closed &&
21872187
!frameGeometry().contains(QCursor::pos())) {
21882188
goto _finish;
21892189
}
@@ -2223,7 +2223,7 @@ void MainWindow::closeEvent(QCloseEvent *ev)
22232223
qDebug() << "uninhibit cookie" << _lastCookie;
22242224
_lastCookie = 0;
22252225
}
2226-
2226+
22272227
int cur = 0;
22282228
if (Settings::get().isSet(Settings::ResumeFromLast)) {
22292229
cur = _engine->playlist().current();
@@ -2239,7 +2239,7 @@ void MainWindow::closeEvent(QCloseEvent *ev)
22392239

22402240
void MainWindow::wheelEvent(QWheelEvent* we)
22412241
{
2242-
if (insideToolsArea(we->pos()) || insideResizeArea(we->globalPos()))
2242+
if (insideToolsArea(we->pos()) || insideResizeArea(we->globalPos()))
22432243
return;
22442244

22452245
if (_playlist->state() == PlaylistWidget::Opened) {
@@ -2278,10 +2278,10 @@ void MainWindow::showEvent(QShowEvent *event)
22782278
}
22792279
}
22802280

2281-
void MainWindow::resizeByConstraints(bool forceCentered)
2281+
void MainWindow::resizeByConstraints(bool forceCentered)
22822282
{
22832283
if (_engine->state() == PlayerEngine::Idle || _engine->playlist().count() == 0) {
2284-
_titlebar->setTitle(tr("Deepin Movie"));
2284+
_titlebar->setTitle(QString());
22852285
return;
22862286
}
22872287

@@ -2305,7 +2305,7 @@ void MainWindow::resizeByConstraints(bool forceCentered)
23052305
}
23062306

23072307
qDebug() << "original: " << size() << "requested: " << sz;
2308-
if (size() == sz)
2308+
if (size() == sz)
23092309
return;
23102310

23112311
if (forceCentered) {
@@ -2378,7 +2378,7 @@ void MainWindow::updateWindowTitle()
23782378
Qt::ElideMiddle, _titlebar->contentsRect().width() - 300);
23792379
_titlebar->setTitle(title);
23802380
} else {
2381-
_titlebar->setTitle(tr("Deepin Movie"));
2381+
_titlebar->setTitle(QString());
23822382
}
23832383
_titlebar->setProperty("idle", _engine->state() == PlayerEngine::Idle);
23842384
_titlebar->setStyleSheet(styleSheet());
@@ -2516,7 +2516,7 @@ void MainWindow::mouseMoveEvent(QMouseEvent *ev)
25162516

25172517
void MainWindow::contextMenuEvent(QContextMenuEvent *cme)
25182518
{
2519-
if (_miniMode || _inBurstShootMode)
2519+
if (_miniMode || _inBurstShootMode)
25202520
return;
25212521

25222522
if (insideToolsArea(cme->pos()))
@@ -2564,7 +2564,7 @@ void MainWindow::paintEvent(QPaintEvent* pe)
25642564
p.fillPath(pp, QColor(0, 0, 0, light ? 255 * 0.1: 255));
25652565

25662566
{
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
25682568
* border area (border has alpha, which blends with background-color.
25692569
*/
25702570
auto view_rect = rect().marginsRemoved(QMargins(1, 1, 1, 1));
@@ -2592,7 +2592,7 @@ void MainWindow::toggleUIMode()
25922592

25932593
if (_miniMode)
25942594
_titlebar->setDisableFlags(Qt::WindowMaximizeButtonHint);
2595-
else
2595+
else
25962596
_titlebar->setDisableFlags(0);
25972597

25982598
if (_listener) _listener->setEnabled(!_miniMode);
@@ -2655,9 +2655,9 @@ void MainWindow::toggleUIMode()
26552655
setGeometry(geom);
26562656

26572657
_miniQuitMiniBtn->move(sz.width() - 14 - _miniQuitMiniBtn->width(),
2658-
sz.height() - 10 - _miniQuitMiniBtn->height());
2658+
sz.height() - 10 - _miniQuitMiniBtn->height());
26592659
_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());
26612661

26622662
} else {
26632663
if (_stateBeforeMiniMode & SBEM_Above) {

0 commit comments

Comments
 (0)