-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Commit before adding new development branch
- changed how new instance arguments work to ensure it works properly in case OS adds it's own arguments on application start. It will require "-i newInstance" in order for a new clean instance to start. This was added because I noticed KDE adds another argument at startup. - removed Stackview from mainWindow as it was unnecessary - changed font of the tray icon - created a custom image provider which is used to show "Provided by OpenWeatherMap" when their API is used, since their logo is square and wouldn't fit properly in that space
- Loading branch information
Showing
7 changed files
with
147 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* | ||
* Copyright (C) 2017 Adrian Verban <[email protected]> | ||
* Maintainers: Adrian Verban <[email protected]> | ||
* Derived from Typhoon by Archisman Panigrahi which is based on Stormcloud by Jono Cooper <jonocooper.com> | ||
* Thanks to all the contributors. | ||
* Using the Ubuntu Condensed font. | ||
* This file is part of Cumulus. | ||
# | ||
* Cumulus is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
# | ||
* Cumulus is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
# | ||
* You should have received a copy of the GNU General Public License | ||
* along with Cumulus. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
#include "CustomImageProvider.h" | ||
#include "Util.h" | ||
|
||
CustomImageProvider::CustomImageProvider() : QQuickImageProvider(QQuickImageProvider::Image) {} | ||
|
||
QImage CustomImageProvider::requestImage(const QString &id, QSize *size, const QSize &requestedSize) { | ||
Q_UNUSED(size) | ||
Q_UNUSED(requestedSize) | ||
if (id == "owm-logo") { | ||
return getImageFromText("Provided by:\nOpenWeatherMap", Util::textColor(), 268, 58); | ||
} | ||
else { | ||
return getImageFromText("", Util::textColor(), 268, 58); | ||
} | ||
} | ||
|
||
QImage CustomImageProvider::getImageFromText(const QString &text, const QString &color, const int &width, const int &height) { | ||
QImage image(width, height, QImage::Format_ARGB32_Premultiplied); | ||
QFont font; | ||
font.setPixelSize(24); | ||
image.fill(Qt::transparent); | ||
QPainter painter(&image); | ||
painter.setFont(font); | ||
painter.setPen(QColor(color)); | ||
painter.drawText(image.rect(), Qt::AlignCenter, text); | ||
return image; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
* Copyright (C) 2017 Adrian Verban <[email protected]> | ||
* Maintainers: Adrian Verban <[email protected]> | ||
* Derived from Typhoon by Archisman Panigrahi which is based on Stormcloud by Jono Cooper <jonocooper.com> | ||
* Thanks to all the contributors. | ||
* Using the Ubuntu Condensed font. | ||
* This file is part of Cumulus. | ||
# | ||
* Cumulus is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
# | ||
* Cumulus is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
# | ||
* You should have received a copy of the GNU General Public License | ||
* along with Cumulus. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
#ifndef CUSTOMIMAGEPROVIDER_H | ||
#define CUSTOMIMAGEPROVIDER_H | ||
|
||
#include <QQuickImageProvider> | ||
#include <QImage> | ||
|
||
class CustomImageProvider : public QQuickImageProvider { | ||
public: | ||
CustomImageProvider(); | ||
QImage requestImage(const QString &id, QSize *size, const QSize &requestedSize); | ||
QImage getImageFromText(const QString &text, const QString &color, const int &width, const int &height); | ||
}; | ||
|
||
#endif // CUSTOMIMAGEPROVIDER_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters