Skip to content

Commit

Permalink
New user interface (#29)
Browse files Browse the repository at this point in the history
* Started with new design

* Lots of new controls and animations

* Lots of new controls and animations

* Lots of new controls and animations

* Add QtGraphicalEffects to Docker

* Add TabPane widget

* Windows fixes

* More cool widgets and animations

* Even more cool widgets and animations

* Fix blurry fonts & LinkButton padding

* Add window control buttons

* Disable font antialiasing globally

* Display application version

* Skeleton code for the log drop-down

* Improve drop shadow performance

* Animate log window

* Window transparency tweaks

* Add scrollbars to log window

* Move MainWindow to its own file

* Remove states from buttons

* Install button colour accents

* Add confirmation dialogs

* Display real data from connected Flipper

* Add colour coding for update channels

* Working update screen overlay

* Fix update channel combobox

* Transparent overlays are invisible

* Possible fix for blurry assets

* Fix blurry window controls

* Fix HiDPI issues

* Some visual improvements

* Fix blurry icon

* Fix blurry icon

* Consistent colour naming and beter statusbar messages

* Remove unnecessary layers

* Add DeviceWidget

* Proper entries in device info pane

* Add recovery mode graphic

* Add default screen graphic

* Add storage info fields

* Make DeviceInfo its own operation

* Display stats on storage and assets

* Update button reacts to settings and firmware

* More sensible update detection

* Suggest update if Assets are missing

* Add Reinstall button

* Use ini format everywhere

* Cleaner ini format setting

* Ask for confirmation when updating

* Add a dialog for displaying the changelog

* Center changelog title

* Stream Flipper's screen on connect

* Add expand widget

* Improved dialogs

* Initial StreamOverlay implementation

* Implement expanded interface for screen streaming

* Fix type error

* Replace Terminus with ProggySquare

* Fix changelog title alignment

* Remove old files

* Remove excess background on TransparentLabel

* Common implementation for custom dialogs

* Style tweaks for CustomDialogs

* New font for changelog and application logs

* Improved colours for Device Info panel

* Properly close Screen Streaming on device disconnect

* Add Install from file option

* Improved Install from file operation

* Minor visual improvements

* Add Reinstall current version feature

* Fix CustomDialog close button

* Add Backup and Restore operations

* Add Factory reset operation

* Fix blurry icon

* Improved confirmaton dialogs

* Temporarily skip zero-size files during backup

* Use hardcoded buttons instead of DialogButtonBox

* Fix crash on some systems

* Do not set fonts and antialias globally

* Fix ComboBox font

* Proper use of std::remove_if

* Clean up main window states

* Minor UI changes

* Bring back the self-update feature

* Set release as the new default update channel

* Use Text widget in ComboBox

* Shift path label if it's too long

* Resizeable log window

* Add a crude implementation of resize on MacOS

* Use a different method for resizing the log window

* Fix MacOS-related visual bugs
  • Loading branch information
gsurkov authored Nov 25, 2021
1 parent cec6901 commit 32ee5a2
Show file tree
Hide file tree
Showing 151 changed files with 6,210 additions and 2,098 deletions.
29 changes: 18 additions & 11 deletions application/application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <QTranslator>
#include <QQmlContext>
#include <QQuickWindow>
#include <QFontDatabase>
#include <QtQuickControls2/QQuickStyle>

#include "qflipperbackend.h"
Expand All @@ -19,10 +20,11 @@ Application::Application(int &argc, char **argv):
debug_msg(QString("%1 version %2 commit %3.").arg(APP_NAME, APP_VERSION, APP_COMMIT));

initQmlTypes();
initInstanceProperties();
initContextProperties();
initTranslations();
initImports();
initStyles();
initFonts();
initGUI();
}

Expand All @@ -38,8 +40,9 @@ AppUpdater *Application::updater()

void Application::initStyles()
{
QQuickWindow::setDefaultAlphaBuffer(true);
QQuickWindow::setTextRenderType(QQuickWindow::NativeTextRendering);
QQuickStyle::setStyle("Universal");
QQuickStyle::setStyle(":/style");
}

void Application::initContextProperties()
Expand All @@ -51,14 +54,6 @@ void Application::initContextProperties()
m_engine.rootContext()->setContextProperty("applicationUpdates", &m_backend.applicationUpdates);
}

void Application::initInstanceProperties()
{
setApplicationName(APP_NAME);
setApplicationVersion(APP_VERSION);
setOrganizationName("Flipper Devices Inc");
setOrganizationDomain("flipperdevices.com");
}

void Application::initTranslations()
{
QTranslator translator;
Expand All @@ -78,6 +73,19 @@ void Application::initQmlTypes()
qmlRegisterType<AppUpdater>("QFlipper", 1, 0, "AppUpdater");
}

void Application::initImports()
{
m_engine.addImportPath(":/imports");
}

void Application::initFonts()
{
QFontDatabase::addApplicationFont(":/assets/fonts/haxrcorp-4089.ttf");
QFontDatabase::addApplicationFont(":/assets/fonts/Born2bSportyV2.ttf");
QFontDatabase::addApplicationFont(":/assets/fonts/ProggySquare.ttf");
QFontDatabase::addApplicationFont(":/assets/fonts/ShareTechMono-Regular.ttf");
}

void Application::initGUI()
{
const QUrl url(QStringLiteral("qrc:/main.qml"));
Expand All @@ -89,6 +97,5 @@ void Application::initGUI()
};

connect(&m_engine, &QQmlApplicationEngine::objectCreated, this, onObjectCreated, Qt::QueuedConnection);

m_engine.load(url);
}
3 changes: 2 additions & 1 deletion application/application.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@ class Application : public QApplication
private:
void initStyles();
void initContextProperties();
void initInstanceProperties();
void initTranslations();
void initQmlTypes();
void initImports();
void initFonts();
void initGUI();

AppUpdater m_updater;
Expand Down
2 changes: 1 addition & 1 deletion application/application.pro
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ CONFIG += embed_translations
QML_IMPORT_PATH =

# Additional import path used to resolve QML modules just for Qt Quick Designer
QML_DESIGNER_IMPORT_PATH =
QML_IMPORT_PATH = $$PWD/imports

unix|win32 {
LIBS += \
Expand Down
5 changes: 3 additions & 2 deletions application/appupdater.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@ bool AppUpdater::canUpdate(const Flipper::Updates::VersionInfo &versionInfo)
if(!globalPrefs()->checkApplicationUpdates()) {
return false;
} else if(globalPrefs()->applicationUpdateChannel() == QStringLiteral("development")) {
return versionInfo.number() != APP_COMMIT;
} else{
const auto appDate = QDateTime::fromSecsSinceEpoch(APP_TIMESTAMP).date();
return (versionInfo.date() > appDate) || ((versionInfo.date() == appDate) && (versionInfo.number() != APP_COMMIT));
} else {
return versionInfo.number() > APP_VERSION;
}
}
Expand Down
Binary file added application/assets/fonts/Born2bSportyV2.ttf
Binary file not shown.
Binary file added application/assets/fonts/ProggySquare.ttf
Binary file not shown.
Binary file not shown.
Binary file added application/assets/fonts/haxrcorp-4089.ttf
Binary file not shown.
27 changes: 27 additions & 0 deletions application/assets/gfx/controls/dpad/back.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 26 additions & 0 deletions application/assets/gfx/controls/dpad/back_down.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 27 additions & 0 deletions application/assets/gfx/controls/dpad/back_hover.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions application/assets/gfx/controls/dpad/circle.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions application/assets/gfx/controls/dpad/circle_down.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions application/assets/gfx/controls/dpad/circle_hover.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 20 additions & 0 deletions application/assets/gfx/controls/dpad/triangle.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions application/assets/gfx/controls/dpad/triangle_down.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions application/assets/gfx/controls/dpad/triangle_hover.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 25 additions & 0 deletions application/assets/gfx/controls/mac/close.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
71 changes: 71 additions & 0 deletions application/assets/gfx/controls/mac/close_down.svg
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 32ee5a2

Please sign in to comment.