Skip to content

Commit

Permalink
chore movie_reborn
Browse files Browse the repository at this point in the history
modify UI
  • Loading branch information
m000555 committed Oct 22, 2019
1 parent c5f12bd commit 66eedbc
Show file tree
Hide file tree
Showing 15 changed files with 283 additions and 70 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,6 @@ include_directories(${PROJECT_BINARY_DIR})
include_directories(${PROJECT_SOURCE_DIR})

configure_file(${PROJECT_SOURCE_DIR}/config.h.in ${PROJECT_BINARY_DIR}/config.h @ONLY)
configure_file(environments.h.in environments.h @ONLY)

add_subdirectory(src)
10 changes: 8 additions & 2 deletions debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
%:
dh $@

override_dh_auto_configure:
dh_auto_configure -- VERSION=$(VERSION) LIB_INSTALL_DIR=/usr/lib/$(DEB_HOST_MULTIARCH) DEFINES+="VERSION=$(DEB_VERSION_UPSTREAM)"
#override_dh_auto_configure:
# dh_auto_configure -- VERSION=$(VERSION) LIB_INSTALL_DIR=/usr/lib/$(DEB_HOST_MULTIARCH) DEFINES+="VERSION=$(DEB_VERSION_UPSTREAM)"


override_dh_auto_configure:
dh_auto_configure -- \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr \
-DAPP_VERSION=$(DEB_VERSION_UPSTREAM) -DVERSION=$(DEB_VERSION_UPSTREAM) LIB_INSTALL_DIR=/usr/lib/$(DEB_HOST_MULTIARCH)
6 changes: 6 additions & 0 deletions environments.h.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#ifndef __ENVIRONMENTS_H_
#define __ENVIRONMENTS_H_

#define VERSION "@VERSION@"

#endif // __ENVIRONMENTS_H_
12 changes: 10 additions & 2 deletions src/backends/mpv/mpv_glwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,11 @@ namespace dmr {
//f->glEnable(GL_BLEND);
//f->glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
float a = 16.0 / 255.0;
if (qApp->theme() != "dark") a = 252.0 / 255.0;

// if (qApp->theme() != "dark") a = 252.0 / 255.0;
if (DGuiApplicationHelper::LightType == DGuiApplicationHelper::instance()->themeType()){
a = 252.0 / 255.0;
}
f->glClearColor(a, a, a, 1.0);


Expand Down Expand Up @@ -634,7 +638,11 @@ namespace dmr {
f->glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
auto clr = QColor(16, 16, 16, 255);
float a = 16.0 / 255.0;
if (qApp->theme() != "dark") {
// if (qApp->theme() != "dark") {
// clr = QColor(252, 252, 252, 255);
// a = 252.0 / 255.0;
// }
if (DGuiApplicationHelper::LightType == DGuiApplicationHelper::instance()->themeType()){
clr = QColor(252, 252, 252, 255);
a = 252.0 / 255.0;
}
Expand Down
3 changes: 2 additions & 1 deletion src/backends/mpv/mpv_glwidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
#include <mpv/opengl_cb.h>
#undef Bool
#include <mpv/qthelper.hpp>

#include <DGuiApplicationHelper>
//DWIDGET_USE_NAMESPACE
namespace dmr {
class MpvGLWidget : public QOpenGLWidget
{
Expand Down
22 changes: 11 additions & 11 deletions src/common/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -813,7 +813,7 @@ void MainWindow::setupTitlebar()
p.drawPixmap((w2-w)/2, (w2-w)/2, logo);
p.end();
_titlebar->titlebar()->setIcon(pm);
_titlebar->titlebar()->setTitle(QString());
_titlebar->setTitletxt(QString());
}

{
Expand Down Expand Up @@ -2173,9 +2173,9 @@ void MainWindow::updateProxyGeometry()
// 220,
// toolbox()->geometry().top() + TOOLBOX_TOP_EXTENT - off
// };
QRect fixed((view_rect.width()-1050)/2, (view_rect.height()-384),
QRect fixed((view_rect.width()-1050)/2, (view_rect.height()-394),
1050,
384 - TOOLBOX_HEIGHT_EXT);
384 - 0);
// fixed.moveRight(view_rect.right());
_playlist->setGeometry(fixed);
}
Expand Down Expand Up @@ -2347,7 +2347,7 @@ void MainWindow::showEvent(QShowEvent *event)
void MainWindow::resizeByConstraints(bool forceCentered)
{
if (_engine->state() == PlayerEngine::Idle || _engine->playlist().count() == 0) {
_titlebar->titlebar()->setTitle(QString());
_titlebar->setTitletxt(QString());
return;
}

Expand Down Expand Up @@ -2442,9 +2442,9 @@ void MainWindow::updateWindowTitle()
const auto& mi = _engine->playlist().currentInfo().mi;
auto title = _titlebar->fontMetrics().elidedText(mi.title,
Qt::ElideMiddle, _titlebar->contentsRect().width() - 300);
_titlebar->titlebar()->setTitle(title);
_titlebar->setTitletxt(title);
} else {
_titlebar->titlebar()->setTitle(QString());
_titlebar->setTitletxt(QString());
}
_titlebar->setProperty("idle", _engine->state() == PlayerEngine::Idle);
// _titlebar->setStyleSheet(styleSheet());
Expand Down Expand Up @@ -2624,7 +2624,7 @@ void MainWindow::paintEvent(QPaintEvent* pe)
QRectF bgRect;
bgRect.setSize(size());
const QPalette pal = QGuiApplication::palette();//this->palette();
QColor bgColor = pal.color(QPalette::Background);
QColor bgColor = pal.color(QPalette::Window);

// QPainterPath path;
// path.addRoundedRect(bgRect, 18, 18);
Expand All @@ -2638,21 +2638,21 @@ void MainWindow::paintEvent(QPaintEvent* pe)
if (rounded) {
QPainterPath pp;
pp.addRoundedRect(bgRect, RADIUS, RADIUS);
painter.fillPath(pp, bgColor);
// painter.fillPath(pp, bgColor);

{
auto view_rect = bgRect.marginsRemoved(QMargins(1, 1, 1, 1));
QPainterPath pp;
pp.addRoundedRect(view_rect, RADIUS, RADIUS);
painter.fillPath(pp, bgColor);
// painter.fillPath(pp, bgColor);
}
} else {
QPainterPath pp;
pp.addRect(bgRect);
painter.fillPath(pp, bgColor);
// painter.fillPath(pp, bgColor);
}
auto pt = bgRect.center() - QPoint(bg.width()/2, bg.height()/2)/devicePixelRatioF();
painter.drawImage(pt, bg);
// painter.drawImage(pt, bg);

/*
QPainter p(this);
Expand Down
4 changes: 3 additions & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
#include "compositing_manager.h"
#include "utils.h"
#include "movie_configuration.h"
#include "environments.h"

DWIDGET_USE_NAMESPACE

Expand Down Expand Up @@ -122,7 +123,8 @@ int main(int argc, char *argv[])
app.setWindowIcon(QIcon(":/resources/icons/logo.svg"));
app.setApplicationDisplayName(QObject::tr("Deepin Movie"));
app.setAttribute(Qt::AA_DontCreateNativeWidgetSiblings, true);
app.setApplicationVersion(DApplication::buildVersion("20190830"));
// app.setApplicationVersion(DApplication::buildVersion("20190830"));
app.setApplicationVersion(DApplication::buildVersion(VERSION));
MovieConfiguration::get().init();

QRegExp url_re("\\w+://");
Expand Down
1 change: 1 addition & 0 deletions src/resources.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
<file>resources/icons/input_clear_hover.svg</file>
<file>resources/icons/input_clear_normal.svg</file>
<file>resources/icons/input_clear_press.svg</file>
<file>resources/icons/titlebar.png</file>

<file>resources/icons/dark/subtitle-selected.svg</file>
<file>resources/icons/light/subtitle-selected.svg</file>
Expand Down
Binary file added src/resources/icons/titlebar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 66eedbc

Please sign in to comment.