Skip to content

Commit

Permalink
tweaked qss & fixed menubar under non-frameless
Browse files Browse the repository at this point in the history
  • Loading branch information
kaniol-lck committed Jul 3, 2024
1 parent e0f8700 commit d822353
Show file tree
Hide file tree
Showing 12 changed files with 375 additions and 245 deletions.
9 changes: 6 additions & 3 deletions src/download/downloadfileinfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@

#include <QDir>

#include "config.hpp"

DownloadFileInfo::DownloadFileInfo(const QUrl &url, const QString &path) :
title_(QObject::tr("Custom Download")),
displayName_(url.fileName()),
fileName_(url.fileName()),
url_(url),
path_(path)
{}
url_(url)
{
path_ = path.isEmpty()? Config().getDownloadPath() : path;
}

DownloadFileInfo::DownloadFileInfo(const CurseforgeFileInfo &info) :
DownloadFileInfo(info.url())
Expand Down
2 changes: 1 addition & 1 deletion src/download/downloadmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ QAria2Downloader *DownloadManager::download(const DownloadFileInfo &info)
model_->beginInsertRows(QModelIndex(), downloaders_.size(), downloaders_.size());
downloaders_ << downloader;
model_->endInsertRows();
qDebug() << "new download job" << info.displayName();
qDebug() << "new download job" << info.displayName() << info.filePath();
emit downloaderAdded(info, downloader);
//handle redirect
downloader->handleRedirect();
Expand Down
3 changes: 2 additions & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include "qss/stylesheets.h"
#include "ui/modmanager.h"

#include <QApplication>
Expand All @@ -19,6 +20,7 @@ int main(int argc, char *argv[])
a.setOrganizationName("kaniol");
a.setApplicationName("Mod Manager");
a.setApplicationDisplayName(QObject::tr("Mod Manager"));
a.setStyleSheet(styleSheetPath(Config().getCustomStyle()));

//setup translator
QTranslator translator;
Expand Down Expand Up @@ -53,7 +55,6 @@ int main(int argc, char *argv[])
#ifdef Q_OS_WIN
if(Config().getUseFramelessWindow()){
auto titleBar = new WindowsTitleBar(&w, w.menuBar());
// QObject::connect(&w, &ModManager::menuBarChanged, titleBar, &WindowsTitleBar::updateMenuBar);
auto frameless = new FramelessWrapper(nullptr, &w, titleBar);
QObject::connect(&w, &ModManager::closed, frameless, &FramelessWrapper::close);
titleBar->setParentWidget(frameless);
Expand Down
102 changes: 71 additions & 31 deletions src/qss/basic.qss
Original file line number Diff line number Diff line change
@@ -1,41 +1,40 @@
QWidget:focus{
QWidget:focus {
outline: none;
}

QTextBrowser, QScrollArea, QScrollArea .QWidget {
/* Tranparent */
Browser .QWidget,
Browser .QWidget .QScrollArea,
QDockWidget .QWidget,
QDockWidget .QTextBrowser,
QDockWidget .QScrollArea,
QDockWidget .QToolButton,
QDockWidget .QLabel {
background-color: transparent;
border-color: transparent;
}

.ModList::item:hover {
border-left: 5px solid #eee;
background-color: #22eeeeee;
}

.ModList::item:selected {
border-left: 5px solid #37d;
background-color: #223377dd;
color: black;
}

.GitHubReleaseItemWidget, .LocalModItemWidget {
/* Label Texts */
.GitHubReleaseItemWidget,
.LocalModItemWidget {
margin-left: 5px;
}

.DateTimeText > * {
color: #777;
.DateTimeText>* {
color: #777777;
font-size: 9pt;
}

.Title {
color: black;
color: #000000;
font-weight: bold;
font-size: 13pt;
background: transparent;
background-color: transparent;
}

.CurseforgeFileListWidget .Title, .ModrinthFileListWidget .Title,
.GitHubFileListWidget .Title, .LocalFileListWidget .Title {
.CurseforgeFileListWidget .Title,
.ModrinthFileListWidget .Title,
.GitHubFileListWidget .Title,
.LocalFileListWidget .Title {
font-size: 11pt;
}

Expand All @@ -45,20 +44,40 @@ QTextBrowser, QScrollArea, QScrollArea .QWidget {
background: transparent;
}

.GitHubReleaseItemWidget > .PreRelease {
color: #fff;
.GitHubReleaseItemWidget>.PreRelease {
color: #ffffff;
background-color: #e7ab34;
border-radius:2px;
padding:1px 2px;
border-radius: 2px;
padding: 1px 2px;
}

.GitHubReleaseItemWidget > .TagName {
color: gray;
.GitHubReleaseItemWidget>.TagName {
color: #777777;
font-size: 10pt;
}

#maxButton:hover,#minButton:hover {
background-color: rgb(218, 218, 218);
/* ModList */
.ModList::item:hover {
border-left: 5px solid #eeeeee;
background-color: #22eeeeee;
}

.ModList::item:selected {
border-left: 5px solid #37d;
background-color: #223377dd;
color: black;
}

/* TitleBar Button */
#maxButton,
#minButton,
#closeButton {
border: none;
}

#maxButton:hover,
#minButton:hover {
background-color: #dbdbdb;
border: none;
}

Expand All @@ -67,14 +86,35 @@ QTextBrowser, QScrollArea, QScrollArea .QWidget {
border: none;
}

QTreeView::item {
min-height: 35px;
/* TitleBar Menu */
QMenuBar {
color: #777777;
}

QMenuBar::item:selected {
background-color: #dbdbdb;
}

QMenuBar::item:pressed {
background-color: #d3d3d3;
color: black;
}

/* Side Bar */
QTreeView.PageSelector::item {
min-height: 40px;
}

QTreeView.PageSelector::item::selected {
border: 1px solid #37d;
background-color: #dbdbdb;
border-radius: 3px;
color: black;
}

QTreeView.PageSelector::item::hover {
border: 1px solid #dbdbdb;
background-color: #eeeeee;
border-radius: 3px;
color: black;
}
Loading

0 comments on commit d822353

Please sign in to comment.