Skip to content

Commit

Permalink
Fix review comments.
Browse files Browse the repository at this point in the history
Signed-off-by: alex-z <[email protected]>
  • Loading branch information
allexzander committed Sep 20, 2023
1 parent f48c459 commit f99d883
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 30 deletions.
9 changes: 5 additions & 4 deletions src/gui/tray/ActivityList.qml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ ScrollView {
property bool scrollingToTop: false

function scrollToTop() {
scrollingToTop = true;
// Triggers activation of repeating upward flick timer
scrollingToTop = true
}

signal openFile(string filePath)
Expand Down Expand Up @@ -45,15 +46,15 @@ ScrollView {
interactive: true

Timer {
id: disappearTimer
interval: 50;
id: repeatUpFlickTimer
interval: 50
running: controlRoot.scrollingToTop
repeat: true
onTriggered: {
if (!activityList.atYBeginning) {
activityList.flick(0, 10000)
} else {
controlRoot.scrollingToTop = false;
controlRoot.scrollingToTop = false
}
}
}
Expand Down
23 changes: 13 additions & 10 deletions src/gui/tray/Window.qml
Original file line number Diff line number Diff line change
Expand Up @@ -853,11 +853,14 @@ ApplicationWindow {

Loader {
id: newActivitiesButtonLoader

anchors.top: activityList.top
anchors.topMargin: 5
anchors.horizontalCenter: activityList.horizontalCenter

width: Style.newActivitiesButtonWidth
height: Style.newActivitiesButtonHeight
anchors.horizontalCenter: activityList.horizontalCenter

z: 1

active: false
Expand All @@ -872,8 +875,8 @@ ApplicationWindow {
contentsFont.bold: true
bgNormalColor: Qt.lighter(bgHoverColor, 1.25)
bgHoverColor: Style.currentUserHeaderColor
bgNormalOpacity: 0.8
bgHoverOpacity: 1.0
bgNormalOpacity: Style.newActivitiesBgNormalOpacity
bgHoverOpacity: Style.newActivitiesBgHoverOpacity

anchors.fill: parent

Expand All @@ -885,26 +888,26 @@ ApplicationWindow {

onClicked: {
activityList.scrollToTop();
newActivitiesButtonLoader.active = false;
newActivitiesButtonLoader.active = false
}

Timer {
id: disappearTimer
interval: 5000;
running: newActivitiesButtonLoader.active && !newActivitiesButton.hovered;
id: newActivitiesButtonDisappearTimer
interval: 5000
running: newActivitiesButtonLoader.active && !newActivitiesButton.hovered
repeat: false
onTriggered: fadeoutDisappearTimer.running = true
onTriggered: fadeoutActivitiesButtonDisappear.running = true
}

OpacityAnimator {
id: fadeoutDisappearTimer
id: fadeoutActivitiesButtonDisappear
target: newActivitiesButton;
from: 1;
to: 0;
duration: 250
loops: 1
running: false
onFinished: newActivitiesButtonLoader.active = false;
onFinished: newActivitiesButtonLoader.active = false
}
}
}
Expand Down
16 changes: 8 additions & 8 deletions src/gui/tray/sortedactivitylistmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,24 +99,24 @@ bool SortedActivityListModel::lessThan(const QModelIndex &sourceLeft, const QMod
return leftIsErrorFileItemStatus;
}

const auto leftActiviyVerbsSearchResult = searchForVerbsInLinks(leftActivity._links);
const auto rightActiviyVerbsSearchResult = searchForVerbsInLinks(rightActivity._links);
const auto leftActivityVerbsSearchResult = searchForVerbsInLinks(leftActivity._links);
const auto rightActivityVerbsSearchResult = searchForVerbsInLinks(rightActivity._links);

if (leftActiviyVerbsSearchResult.hasPOST && !rightActiviyVerbsSearchResult.hasPOST) {
if (leftActivityVerbsSearchResult.hasPOST && !rightActivityVerbsSearchResult.hasPOST) {
return true;
} else if (!leftActiviyVerbsSearchResult.hasPOST && rightActiviyVerbsSearchResult.hasPOST) {
} else if (!leftActivityVerbsSearchResult.hasPOST && rightActivityVerbsSearchResult.hasPOST) {
return false;
}

if (leftActiviyVerbsSearchResult.hasREPLY && !rightActiviyVerbsSearchResult.hasREPLY) {
if (leftActivityVerbsSearchResult.hasREPLY && !rightActivityVerbsSearchResult.hasREPLY) {
return true;
} else if (!leftActiviyVerbsSearchResult.hasREPLY && rightActiviyVerbsSearchResult.hasREPLY) {
} else if (!leftActivityVerbsSearchResult.hasREPLY && rightActivityVerbsSearchResult.hasREPLY) {
return false;
}

if (leftActiviyVerbsSearchResult.hasWEB && !rightActiviyVerbsSearchResult.hasWEB) {
if (leftActivityVerbsSearchResult.hasWEB && !rightActivityVerbsSearchResult.hasWEB) {
return true;
} else if (!leftActiviyVerbsSearchResult.hasWEB && rightActiviyVerbsSearchResult.hasWEB) {
} else if (!leftActivityVerbsSearchResult.hasWEB && rightActivityVerbsSearchResult.hasWEB) {
return false;
}

Expand Down
14 changes: 7 additions & 7 deletions src/gui/tray/syncstatussummary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -214,15 +214,15 @@ void SyncStatusSummary::onFolderProgressInfo(const ProgressInfo &progress)
const qint64 currentFile = progress.currentFile();
const qint64 completedFile = progress.completedFiles();
const qint64 totalSize = qMax(completedSize, progress.totalSize());
const qint64 totalFileCount = qMax(currentFile, progress.totalFiles());
const qint64 numFilesInProgress = qMax(currentFile, progress.totalFiles());

if (_totalFiles <= 0 && totalFileCount > 0) {
if (_totalFiles <= 0 && numFilesInProgress > 0) {
setSyncStatusString(tr("Syncing"));
}

setTotalFiles(totalFileCount);
setTotalFiles(numFilesInProgress);

setSyncProgress(calculateOverallPercent(totalFileCount, completedFile, totalSize, completedSize));
setSyncProgress(calculateOverallPercent(numFilesInProgress, completedFile, totalSize, completedSize));

if (totalSize > 0) {
const auto completedSizeString = Utility::octetsToString(completedSize);
Expand All @@ -238,8 +238,8 @@ void SyncStatusSummary::onFolderProgressInfo(const ProgressInfo &progress)
}
}

if (totalFileCount > 0) {
setSyncStatusString(tr("Syncing file %1 of %2").arg(currentFile).arg(totalFileCount));
if (numFilesInProgress > 0) {
setSyncStatusString(tr("Syncing file %1 of %2").arg(currentFile).arg(numFilesInProgress));
}
}

Expand All @@ -253,7 +253,7 @@ void SyncStatusSummary::setSyncing(bool value)
emit syncingChanged();
}

void SyncStatusSummary::setTotalFiles(qint64 value)
void SyncStatusSummary::setTotalFiles(const qint64 value)
{
if (value != _totalFiles) {
_totalFiles = value;
Expand Down
2 changes: 1 addition & 1 deletion src/gui/tray/syncstatussummary.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public slots:
void setSyncStatusDetailString(const QString &value);
void setSyncIcon(const QUrl &value);
void setAccountState(AccountStatePtr accountState);
void setTotalFiles(qint64 value);
void setTotalFiles(const qint64 value);

AccountStatePtr _accountState;
std::set<QString> _foldersWithErrors;
Expand Down
3 changes: 3 additions & 0 deletions theme/Style/Style.qml
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,9 @@ QtObject {
property int newActivitiesButtonWidth: 150
property int newActivitiesButtonHeight: 40

property real newActivitiesBgNormalOpacity: 0.8
property real newActivitiesBgHoverOpacity: 1.0

function variableSize(size) {
return size * (1 + Math.min(pixelSize / 100, 1));
}
Expand Down

0 comments on commit f99d883

Please sign in to comment.