Skip to content
This repository has been archived by the owner on Feb 13, 2024. It is now read-only.

[WIP] Port the Linux app to QML and partially implement the macOS design #3618

Open
wants to merge 86 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
86 commits
Select commit Hold shift + click to select a range
82c1eb3
Implement a mockup login screen with QML (linux)
MartinBriza Oct 14, 2019
0032b59
Enable displaying errors (linux)
MartinBriza Oct 14, 2019
9c9fb05
Animate the error overlay (linux)
MartinBriza Oct 14, 2019
1fd8538
Enable hitting Return on text fields to log in (linux)
MartinBriza Oct 14, 2019
3e819bb
Move views to separate files, handle onDisplayError signal (linux)
MartinBriza Oct 14, 2019
6dac66b
Start implementing time entry view (linux)
MartinBriza Oct 14, 2019
f8cb8e4
Display basic time entry info, implement mockup Timer (linux)
MartinBriza Oct 14, 2019
9c8e82f
Make the Timer work almost right (linux)
MartinBriza Oct 14, 2019
98b4c75
Make starting and stopping work mostly as expected
MartinBriza Oct 14, 2019
e931a8d
Enable editing the duration but it doesn't work right (linux)
MartinBriza Oct 14, 2019
877391b
Make the timer look prettier (linux)
MartinBriza Oct 14, 2019
42df6dc
Enable working with the time entry list (linux)
MartinBriza Oct 14, 2019
65bc89d
Make the timer a lot prettier (linux)
MartinBriza Oct 14, 2019
b8b5a9a
Implement a basic menu (linux)
MartinBriza Oct 14, 2019
d3b70f0
Add headers and scrollbars to the items in the list (linux)
MartinBriza Oct 14, 2019
d7f5302
Make everything look a bit more similar to the current app (linux)
MartinBriza Oct 14, 2019
e238710
Force native font rendering (linux)
MartinBriza Oct 15, 2019
7535ceb
Handle signup country ID right (linux)
MartinBriza Oct 15, 2019
1faa700
Don't do anything on Google signup (linux)
MartinBriza Oct 15, 2019
a3070f3
Clip the error overlay to avoid red flickers (linux)
MartinBriza Oct 15, 2019
321c8e8
Add a readonly Time Entry View (linux)
MartinBriza Oct 15, 2019
06c5d3f
Basic nonfunctional autocomplete implementation (linux)
MartinBriza Oct 15, 2019
190529f
Reuse the old AutocompleteListModel class to implement filtering (linux)
MartinBriza Oct 15, 2019
c97d72c
Meh autocomplete is broken this way, i'll have to rewrite it but i do…
MartinBriza Oct 15, 2019
8bca438
Some lame attempts at animating the time entry list (linux)
MartinBriza Oct 15, 2019
67cbc77
(Probably) implement a list model that handles time entry list change…
MartinBriza Oct 16, 2019
8dde721
Because GUIDs are not really unique, handle special cases and create …
MartinBriza Oct 17, 2019
656b01f
Make working with the time entry list prettier (linux)
MartinBriza Oct 17, 2019
6edde6d
Make Autocomplete work mostly as expected
MartinBriza Oct 17, 2019
705f76d
Get "heavily inspired" by the macOS design (linux)
MartinBriza Oct 18, 2019
4c571d7
UI tweaks, especially placing the time entry edit view next to the wi…
MartinBriza Oct 18, 2019
bb48feb
Enable adding and removing tags in a nice fashion (linux)
MartinBriza Oct 18, 2019
2f19556
Lay out the tags on a line (linux)
MartinBriza Oct 18, 2019
9030c4e
Redesign the QML project UI (linux)
MartinBriza Oct 18, 2019
0bca620
Make the Linux app compile on macOS (all)
MartinBriza Nov 29, 2019
b0bbba9
Try building this in GitHub Actions (macos)
MartinBriza Nov 29, 2019
e798071
Fix colors in darkmode (linux)
MartinBriza Nov 29, 2019
d426ae3
Make the timer look more like the macOS app (linux)
MartinBriza Nov 29, 2019
9c67a0f
Fix the Actions workflow (macos)
MartinBriza Nov 29, 2019
10c0db6
Make the time entry list look similar to macOS (linux)
MartinBriza Nov 29, 2019
94e5572
...
MartinBriza Nov 29, 2019
33d3e52
Split off shadows and list items into separate items (linux)
MartinBriza Dec 2, 2019
0f6177b
Prune undefined references (linux)
MartinBriza Dec 3, 2019
c3b6bc5
Fix up the look of the Time Entry Editor view (linux)
MartinBriza Dec 3, 2019
c92a9f4
Get rid of all unnecessary C++ UI code (linux)
MartinBriza Dec 3, 2019
9ad58b2
Fix QML C++ bindings (linux)
MartinBriza Dec 3, 2019
36fc2b2
Format main.cpp (linux)
MartinBriza Dec 3, 2019
0db04d2
Work on improving the design and clean up the QML code (linux)
MartinBriza Dec 3, 2019
8c1a3bd
Fix type errors (linux)
MartinBriza Dec 3, 2019
0ce331f
Make the time entry labels look more like on macOS (linux)
MartinBriza Dec 3, 2019
d9a16ac
Style autocomplete to look more like on macOS (linux)
MartinBriza Dec 3, 2019
e28cb4c
Keep left margin in open group items in the list (linux)
MartinBriza Dec 3, 2019
da491b6
Make the Linux app compile on Windows (win)
MartinBriza Dec 3, 2019
154622e
Use QQC1 ScrollView because it doesn't glitch on macOS (linux)
MartinBriza Dec 4, 2019
5fc306a
Fix string issues (linux)
MartinBriza Dec 4, 2019
aabf413
Rename palette to mainPalette to avoid conflicts (linux)
MartinBriza Dec 4, 2019
a26a9cf
Make the TE Editor a bit prettier (linux)
MartinBriza Dec 4, 2019
5d46d1f
Reintroduce main window menu, connect some actions (linux)
MartinBriza Dec 4, 2019
adea372
Touch up the look of the login view (linux)
MartinBriza Dec 4, 2019
c5f7b47
Add an inline Time Entry Editor to the List (linux)
MartinBriza Dec 5, 2019
099a469
Disable the annoying flickering in the delegate (linux)
MartinBriza Dec 5, 2019
c587ea5
Fix crash with autocomplete (linux)
MartinBriza Dec 5, 2019
5ad8e5b
Make autocomplete actually do something for Time Entries (linux)
MartinBriza Dec 5, 2019
7646628
Hide group count when an entry is expanded (linux)
MartinBriza Dec 5, 2019
14297c0
Fix typo
MartinBriza Dec 5, 2019
b46ac6b
Make the duration layout in the editor responsive (linux)
MartinBriza Dec 5, 2019
089f34b
Allow actually logging in (linux)
MartinBriza Dec 6, 2019
4d5c080
Start implementing the date picker (linux)
MartinBriza Dec 6, 2019
d46d7f8
Make the Arrow element separate (linux)
MartinBriza Dec 9, 2019
22a1289
Fix the terminal spam from Autocomplete (linux)
MartinBriza Dec 9, 2019
c0652a8
Implement an embedded calendar widget (linux)
MartinBriza Dec 9, 2019
596c713
Improve Calendar performance by loading it on demand (linux)
MartinBriza Dec 9, 2019
1e9f63c
Fix some more QML errors in the terminal (linux)
MartinBriza Dec 10, 2019
8eb7f4d
Make space for the calendar by hiding some UI elements (linux)
MartinBriza Dec 10, 2019
e5a77d8
Set dates right (linux)
MartinBriza Dec 11, 2019
da9d447
Added app build command for qt in mac
IndrekV Dec 13, 2019
e2ac6dd
Improve login view look (especially the horrible blue) (linux)
MartinBriza Dec 13, 2019
38034b5
Return the preferences dialog (linux)
MartinBriza Dec 13, 2019
31d8adb
Actually display errors (linux)
MartinBriza Dec 13, 2019
1d52f39
Probably fix build on macOS (lib)
MartinBriza Apr 6, 2020
6a21908
Now actually probably fix it (lib)
MartinBriza Apr 6, 2020
54c3947
Remove objC files from CMakeLists.txt (mac)
MartinBriza Jul 14, 2020
1b9a9d4
Readd the version checker source file (mac)
MartinBriza Jul 14, 2020
11a90d9
Try building the Windows version in GA (win)
MartinBriza Jul 14, 2020
6b580ca
Partially get rid of leftovers from the rebase (actions)
MartinBriza Sep 4, 2020
3fa148d
Fix stuff I broke when rebasing (linux)
MartinBriza Sep 4, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
# Create a new keychian and make it default
security create-keychain -p password build.keychain
security default-keychain -s ~/Library/Keychains/build.keychain

# Mac Developer Certificate
base64 -D <<< "${{ secrets.CERT_MACOS_DEVELOPER }}" > Bundle_cert_macos_developer.p12
security import ./Bundle_cert_macos_developer.p12 -k ~/Library/Keychains/build.keychain -P ${{ secrets.CERT_MACOS_DEVELOPER_PASSWORD }} -T /usr/bin/codesign
Expand All @@ -65,7 +65,7 @@ jobs:
security unlock-keychain -p password ~/Library/Keychains/build.keychain
security set-keychain-settings -lu
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k password ~/Library/Keychains/build.keychain

- name: Cache cocoapods
uses: actions/cache@v2
with:
Expand Down Expand Up @@ -190,7 +190,7 @@ jobs:
- name: Install dependencies
run: |
sudo apt update
sudo apt install libxss1 libgstreamer-plugins-base1.0-0 libgstreamer1.0-0 qt5-default libqt5gui5 libqt5printsupport5 libqt5quickwidgets5 libqt5x11extras5 libqt5networkauth5 libxss1
sudo apt install libxss1 libgstreamer-plugins-base1.0-0 libgstreamer1.0-0 qt5-default libqt5gui5 libqt5printsupport5 libqt5quickwidgets5 libqt5x11extras5 libqt5networkauth5 libxss1 libqt5quickwidgets5
sudo apt install patchelf binutils cmake pkg-config qtbase5-dev libqt5x11extras5-dev qtbase5-private-dev libqt5networkauth5-dev libssl-dev libxss-dev libxmu-dev
- name: Build the Linux binary
run: |
Expand Down
8 changes: 8 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ option(TOGGL_PRODUCTION_BUILD "Use production servers in the app" OFF)
option(TOGGL_ALLOW_UPDATE_CHECK "Allow the app to check for updates" OFF)
option(USE_BUNDLED_LIBRARIES "Prefer bundled libraries to bundled ones" OFF)
option(INSTALL_HIRES_ICONS "Do not install icons over 512x512" OFF)
option(TOGGL_BUILD_TESTS "Build the Toggl test suite" ON)

set(ENV{OPENSSL_ROOT_DIR} ${OPENSSL_ROOT_DIR})
if (NOT "${OPENSSL_ROOT_DIR}" STREQUAL "")
include_directories("${OPENSSL_ROOT_DIR}/include")
endif()

set(ENV{OPENSSL_ROOT_DIR} ${OPENSSL_ROOT_DIR})
if (NOT "${OPENSSL_ROOT_DIR}" STREQUAL "")
Expand Down Expand Up @@ -50,9 +56,11 @@ include(FindPkgConfig)

# Look for Qt
find_package(Qt5Widgets CONFIG REQUIRED)
find_package(Qt5QuickWidgets CONFIG REQUIRED)
find_package(Qt5DBus CONFIG REQUIRED)
find_package(Qt5Network CONFIG REQUIRED)
find_package(Qt5NetworkAuth CONFIG REQUIRED)
find_package(Qt5Quick CONFIG REQUIRED)
# We need to include private headers manually
include_directories( ${Qt5Widgets_PRIVATE_INCLUDE_DIRS} )
if (UNIX AND NOT APPLE)
Expand Down
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,11 @@ qa: lint fmt cppclean test

fmt: fmt_lib fmt_ui


app_qt:
mkdir -p build && cd build && cmake -DOPENSSL_ROOT_DIR="/usr/local/opt/[email protected]" -DTOGGL_BUILD_TESTS=OFF .. && make
./build/src/ui/linux/TogglDesktop/TogglDesktop

ifeq ($(uname), Linux)
app:
mkdir -p build && cd build && cmake .. && make
Expand Down
2 changes: 2 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ include_directories(
${LUA_INCLUDE_DIRS}
${JSONCPP_INCLUDE_DIRS}
${POCO_INCLUDE_DIRS}
"$ENV{OPENSSL_ROOT_DIR}/include"
)

# TogglDesktopLibrary sources
Expand Down Expand Up @@ -61,6 +62,7 @@ set(LIBRARY_SOURCE_FILES
context.cc
error.cc
feedback.cc
error.cc
gui.cc
help_article.cc
https_client.cc
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
23 changes: 23 additions & 0 deletions src/ui/linux/TogglDesktop/Arrow.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import QtQuick 2.0

Item {
width: 7
height: 3
Rectangle {
smooth: true
anchors.verticalCenter: parent.verticalCenter
width: 4
height: 1
rotation: 45
opacity: 0.5
}
Rectangle {
smooth: true
x: 3
anchors.verticalCenter: parent.verticalCenter
width: 4
height: 1
rotation: -45
opacity: 0.5
}
}
201 changes: 201 additions & 0 deletions src/ui/linux/TogglDesktop/AutocompleteView.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,201 @@
import QtQuick 2.12
import QtQuick.Layouts 1.12
import QtQuick.Controls 1.4

Item {
id: root
height: 500

property real maximumHeight: 500

property var model: null
property QtObject currentItem: list.currentItem ? list.currentItem.autocompleteData : null

property string filter: ""
onFilterChanged: {
toggl.minitimerAutocomplete.setFilter(filter)
list.currentIndex = -1
}
onVisibleChanged: list.currentIndex = -1

function upPressed() {
//console.log("Current index: " + list.currentIndex)
//console.log("There is " + list.count + " rows")
//console.log("Model reports " + model.count() + " rows")
for (var i = list.currentIndex - 1; i > 0 ; --i) {
if (model.get(i).Type < 10) {
list.currentIndex = i
list.positionViewAtIndex(i, ListView.Center)
//console.log("Current index: " + list.currentIndex)
return
}
}
//console.log("Current index: " + list.currentIndex)
}
function downPressed() {
//console.log("Current index: " + list.currentIndex)
//console.log("There is " + list.count + " rows")
//console.log("Model reports " + model.count() + " rows")
for (var i = list.currentIndex + 1; i < list.count; i++) {
if (model.get(i).Type < 10) {
list.currentIndex = i
list.positionViewAtIndex(i, ListView.Center)
//console.log("Current index: " + list.currentIndex)
return
}
}
//console.log("Current index: " + list.currentIndex)
}

Text {
z: 20
text: list.currentItem ? list.currentItem.autocompleteData.Description : ""
}

Rectangle {
z: -1
anchors.fill: parent
color: setAlpha(mainPalette.shadow, 0.5)
}

ScrollView {
id: scrollArea
width: parent.width
height: root.maximumHeight
clip: true
ListView {
id: list
model: root.model
currentIndex: -1
onCurrentIndexChanged: {
console.log(currentIndex)
}

onCountChanged: {
var base = list.visibleChildren[0]
var listViewHeight = 0
if (!base)
return
for (var i = 0; i < base.visibleChildren.length; i++)
listViewHeight += base.visibleChildren[i].height
list.height = Math.min(listViewHeight, root.maximumHeight)
}
highlightFollowsCurrentItem: true
highlight: Rectangle {
z: 30
color: "light gray"
opacity: 0.5
width: root.width
height: 24
}
delegate: Loader {
// TODO use the enum instead of magic values
sourceComponent: autocompleteData && autocompleteData.Type === 13 ? workspaceDelegate :
autocompleteData && autocompleteData.Type === 12 ? clientDelegate :
autocompleteData && autocompleteData.Type === 11 ? headerDelegate :
regularDelegate
property var autocompleteData: modelData
property int index: index
}
}
}

Component {
id: workspaceDelegate

Rectangle {
height: 40
width: root.width
color: mainPalette.base
Text {
anchors.centerIn: parent
color: mainPalette.text

text: autocompleteData && autocompleteData.Description
font.pointSize: 14
}
Rectangle {
anchors {
left: parent.left
bottom: parent.bottom
right: parent.right
}
height: 1
color: mainPalette.alternateBase
}
}
}

Component {
id: clientDelegate


Rectangle {
height: 30
width: root.width
color: mainPalette.base
Text {
anchors.left: parent.left
anchors.leftMargin: 12
anchors.verticalCenter: parent.verticalCenter
height: 24
x: 9
color: mainPalette.text

text: autocompleteData && autocompleteData.Description
}
}
}

Component {
id: headerDelegate

Rectangle {
height: 30
width: root.width
color: mainPalette.base
Text {
anchors.left: parent.left
anchors.leftMargin: 12
anchors.verticalCenter: parent.verticalCenter
text: autocompleteData && autocompleteData.Description
color: mainPalette.text
font.pointSize: 11
}
}
}

Component {
id: regularDelegate

Rectangle {
height: 30
width: root.width
color: mainPalette.base

Text {
anchors.fill: parent
anchors.left: parent.left
anchors.leftMargin: 18
verticalAlignment: Text.AlignVCenter
x: 9
textFormat: Text.RichText
property string timeEntry: autocompleteData ? autocompleteData.Description : ""
property string project: autocompleteData && autocompleteData.ProjectLabel.length > 0 ?
"<font color=" + autocompleteData.ProjectColor + "> • " + autocompleteData.ProjectLabel + "</font>" :
""
property string task: autocompleteData && autocompleteData.TaskLabel.length > 0 ? " " + autocompleteData.TaskLabel : ""
text: (ListView.isCurrentItem ? "Iscurrent" : "") + timeEntry + project + task
font.pointSize: 12
color: mainPalette.text
}
MouseArea {
id: delegateMouse
anchors.fill: parent
hoverEnabled: true
onContainsMouseChanged: {
}
}
}
}
}
38 changes: 8 additions & 30 deletions src/ui/linux/TogglDesktop/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,67 +14,45 @@ include_directories(

# TogglDesktop sources
set(BINARY_SOURCE_FILES
aboutdialog.cpp
autocompletecombobox.cpp
autocompletelistview.cpp
autocompletelistmodel.cpp
autocompleteview.cpp
clickablelabel.cpp
colorpicker.cpp
countryview.cpp
errorviewcontroller.cpp
feedbackdialog.cpp
genericview.cpp
idlenotificationwidget.cpp
loginwidget.cpp
main.cpp
mainwindowcontroller.cpp
mainwindow.cpp
networkmanagement.cpp
overlaywidget.cpp
powermanagement.cpp
preferencesdialog.cpp
qmlobjectlist.cc
settingsview.cpp
singleapplication.cpp
systemtray.cpp
timeentrycellwidget.cpp
timeentryeditorwidget.cpp
timeentrylistwidget.cpp
timeentryview.cpp
timerwidget.cpp
toggl.cpp

# Resources have to be listed
Resources.qrc

# it's better to list UI files
aboutdialog.ui
colorpicker.ui
errorviewcontroller.ui
feedbackdialog.ui
idlenotificationwidget.ui
loginwidget.ui
mainwindowcontroller.ui
overlaywidget.ui
mainwindow.ui
preferencesdialog.ui
timeentrycellwidget.ui
timeentryeditorwidget.ui
timeentrylistwidget.ui
timerwidget.ui
)

if (UNIX AND NOT APPLE)
set (TOGGLDESKTOP_ADDITIONAL_LIBS
-lX11 -lXss
if (APPLE)
set(BINARY_SOURCE_FILES ${BINARY_SOURCE_FILES}
macosSpecific.mm
)
endif()

# Set up compilation targets
add_executable(TogglDesktop ${BINARY_SOURCE_FILES})
add_executable(TogglDesktop ${BINARY_SOURCE_FILES} ${PLATFORM_SPECIFIC_FILES})

# And list the dependencies between them (and system libraries)
target_link_libraries(TogglDesktop PRIVATE
TogglDesktopLibrary
Qt5::Widgets Qt5::DBus Qt5::NetworkAuth
Qt5::Widgets Qt5::DBus Qt5::NetworkAuth Qt5::Qml Qt5::Quick Qt5::QuickWidgets
${QXT_LIBRARIES}
Bugsnag
${TOGGLDESKTOP_ADDITIONAL_LIBS}
Expand Down
Loading