Skip to content

Commit

Permalink
#2986 add: line-edit clear icon for dark-mode to dialogs
Browse files Browse the repository at this point in the history
  • Loading branch information
pbek committed Mar 18, 2024
1 parent 1c51974 commit b246c66
Show file tree
Hide file tree
Showing 32 changed files with 45 additions and 3 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
# QOwnNotes Changelog

## 24.3.4
- For the dark-mode there now is a new icon for the clear button for all line edits,
like the note search field, in the main window and all dialogs
(for [#2986](https://github.com/pbek/QOwnNotes/issues/2986))

## 24.3.3
- added a **new editor color schema** *VSCodium* by @nkahe
- Added a **new editor color schema** *VSCodium* by @nkahe
(for [#2982](https://github.com/pbek/QOwnNotes/issues/2982))

## 24.3.2
Expand Down
1 change: 1 addition & 0 deletions src/dialogs/aboutdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

AboutDialog::AboutDialog(QWidget *parent) : MasterDialog(parent), ui(new Ui::AboutDialog) {
ui->setupUi(this);
afterSetupUI();

// load the about.html
QFile f(QStringLiteral(":/html/about.html"));
Expand Down
1 change: 1 addition & 0 deletions src/dialogs/actiondialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ ActionDialog::ActionDialog(QMenuBar *menuBar, QWidget *parent)
: MasterDialog(parent), ui(new Ui::ActionDialog) {
_menuBar = menuBar;
ui->setupUi(this);
afterSetupUI();
refreshUi();
}

Expand Down
1 change: 1 addition & 0 deletions src/dialogs/attachmentdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
AttachmentDialog::AttachmentDialog(QWidget *parent)
: MasterDialog(parent), ui(new Ui::AttachmentDialog) {
ui->setupUi(this);
afterSetupUI();
ui->fileEdit->setFocus();
ui->downloadButton->hide();
ui->downloadFrame->hide();
Expand Down
1 change: 1 addition & 0 deletions src/dialogs/dictionarymanagerdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
DictionaryManagerDialog::DictionaryManagerDialog(QWidget *parent)
: MasterDialog(parent), ui(new Ui::DictionaryManagerDialog) {
ui->setupUi(this);
afterSetupUI();
setupMainSplitter();

_networkManager = new QNetworkAccessManager(this);
Expand Down
1 change: 1 addition & 0 deletions src/dialogs/evernoteimportdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
EvernoteImportDialog::EvernoteImportDialog(QWidget *parent)
: MasterDialog(parent), ui(new Ui::EvernoteImportDialog) {
ui->setupUi(this);
afterSetupUI();
setupMetaDataTreeWidgetItems();
resetNoteCount();
_mediaFileDataHash.clear();
Expand Down
1 change: 1 addition & 0 deletions src/dialogs/imagedialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ ImageDialog::ImageDialog(QWidget *parent) : MasterDialog(parent), ui(new Ui::Ima
_rubberBand = nullptr;

ui->setupUi(this);
afterSetupUI();
ui->fileEdit->setFocus();
ui->previewFrame->setVisible(false);
ui->toolFrame->hide();
Expand Down
1 change: 1 addition & 0 deletions src/dialogs/issueassistantdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
IssueAssistantDialog::IssueAssistantDialog(QWidget *parent)
: MasterDialog(parent), ui(new Ui::IssueAssistantDialog) {
ui->setupUi(this);
afterSetupUI();
ui->backButton->setEnabled(false);
ui->nextButton->setEnabled(false);

Expand Down
1 change: 1 addition & 0 deletions src/dialogs/joplinimportdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
JoplinImportDialog::JoplinImportDialog(QWidget* parent)
: MasterDialog(parent), ui(new Ui::JoplinImportDialog) {
ui->setupUi(this);
afterSetupUI();

ui->progressBar->hide();
ui->progressBar->setMinimum(0);
Expand Down
1 change: 1 addition & 0 deletions src/dialogs/linkdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
LinkDialog::LinkDialog(int page, const QString &dialogTitle, QWidget *parent)
: MasterDialog(parent), ui(new Ui::LinkDialog) {
ui->setupUi(this);
afterSetupUI();
ui->tabWidget->setCurrentIndex(page);
on_tabWidget_currentChanged(page);
ui->downloadProgressBar->hide();
Expand Down
1 change: 1 addition & 0 deletions src/dialogs/localtrashdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class LocalTrashTreeWidgetItem : public QTreeWidgetItem {
LocalTrashDialog::LocalTrashDialog(QWidget *parent)
: MasterDialog(parent), ui(new Ui::LocalTrashDialog) {
ui->setupUi(this);
afterSetupUI();

// init the note browser search frame
ui->noteBrowser->initSearchFrame(ui->noteBrowserSearchFrame);
Expand Down
5 changes: 5 additions & 0 deletions src/dialogs/masterdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <QSettings>

#include "services/metricsservice.h"
#include "utils/gui.h"

MasterDialog::MasterDialog(QWidget *parent) : QDialog(parent) { installEventFilter(this); }

Expand All @@ -15,6 +16,10 @@ void MasterDialog::closeEvent(QCloseEvent *event) {
QDialog::closeEvent(event);
}

void MasterDialog::afterSetupUI() {
Utils::Gui::fixDarkModeIcons(this);
}

void MasterDialog::resizeEvent(QResizeEvent *event) {
// save the geometry of the dialog
storeGeometrySettings();
Expand Down
2 changes: 2 additions & 0 deletions src/dialogs/masterdialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ class MasterDialog : public QDialog {

virtual void keyPressEvent(QKeyEvent *keyEvent) override;

void afterSetupUI();

public:
void setIgnoreReturnKey(bool ignore);
};
1 change: 1 addition & 0 deletions src/dialogs/nextclouddeckdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
NextcloudDeckDialog::NextcloudDeckDialog(QWidget *parent)
: MasterDialog(parent), ui(new Ui::NextcloudDeckDialog) {
ui->setupUi(this);
afterSetupUI();
ui->dueDateTimeEdit->setDateTime(QDateTime::currentDateTime());
ui->saveButton->setEnabled(false);
ui->dueDateTimeCheckBox->setChecked(true);
Expand Down
1 change: 1 addition & 0 deletions src/dialogs/notedialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

NoteDialog::NoteDialog(QWidget *parent) : MasterDialog(parent), ui(new Ui::NoteDialog) {
ui->setupUi(this);
afterSetupUI();
ui->textEdit->initSearchFrame(ui->searchFrame);
ui->textEdit->setReadOnly(true);
ui->tabWidget->setCurrentIndex(QSettings().value("NoteDialog/tabWidgetIndex").toInt());
Expand Down
1 change: 1 addition & 0 deletions src/dialogs/notediffdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
NoteDiffDialog::NoteDiffDialog(QWidget *parent, const QString &html)
: MasterDialog(parent), ui(new Ui::NoteDiffDialog) {
ui->setupUi(this);
afterSetupUI();

_notificationButtonGroup = new QButtonGroup(this);
_notificationButtonGroup->addButton(ui->ignoreAllExternalChangesCheckBox);
Expand Down
1 change: 1 addition & 0 deletions src/dialogs/passworddialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ PasswordDialog::PasswordDialog(QWidget *parent, const QString &labelText, bool d
_doubleEnterPassword = doubleEnterPassword;

ui->setupUi(this);
afterSetupUI();

// Set focus to the password line edit manually, because focus by tab order
// was not working for release builds
Expand Down
1 change: 1 addition & 0 deletions src/dialogs/scriptrepositorydialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
ScriptRepositoryDialog::ScriptRepositoryDialog(QWidget *parent, bool checkForUpdates)
: MasterDialog(parent), ui(new Ui::ScriptRepositoryDialog) {
ui->setupUi(this);
afterSetupUI();
setupMainSplitter();

_codeSearchUrl = QLatin1String("https://api.github.com/search/code");
Expand Down
1 change: 1 addition & 0 deletions src/dialogs/serverbookmarksimportdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
ServerBookmarksImportDialog::ServerBookmarksImportDialog(const QJSValue &bookmarks, QWidget *parent)
: MasterDialog(parent), ui(new Ui::ServerBookmarksImportDialog) {
ui->setupUi(this);
afterSetupUI();
ui->infoLabel->clear();

// init the iterator for the versions
Expand Down
1 change: 1 addition & 0 deletions src/dialogs/settingsdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
SettingsDialog::SettingsDialog(int page, QWidget *parent)
: MasterDialog(parent), ui(new Ui::SettingsDialog) {
ui->setupUi(this);
afterSetupUI();

bool fromWelcomeDialog = parent->objectName() == QLatin1String("WelcomeDialog");

Expand Down
1 change: 1 addition & 0 deletions src/dialogs/sharedialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
ShareDialog::ShareDialog(const Note &note, QWidget *parent)
: MasterDialog(parent), ui(new Ui::ShareDialog) {
ui->setupUi(this);
afterSetupUI();
this->note = note;

// update the share link checkbox and link url line edit
Expand Down
1 change: 1 addition & 0 deletions src/dialogs/storedattachmentsdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
StoredAttachmentsDialog::StoredAttachmentsDialog(QWidget *parent)
: MasterDialog(parent), ui(new Ui::StoredAttachmentsDialog) {
ui->setupUi(this);
afterSetupUI();
ui->infoFrame->setEnabled(false);
ui->fileTreeWidget->installEventFilter(this);

Expand Down
1 change: 1 addition & 0 deletions src/dialogs/storedimagesdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
StoredImagesDialog::StoredImagesDialog(QWidget *parent)
: MasterDialog(parent), ui(new Ui::StoredImagesDialog) {
ui->setupUi(this);
afterSetupUI();
ui->fileTreeWidget->installEventFilter(this);
ui->noteTreeWidget->installEventFilter(this);

Expand Down
1 change: 1 addition & 0 deletions src/dialogs/tabledialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

TableDialog::TableDialog(QWidget *parent) : MasterDialog(parent), ui(new Ui::TableDialog) {
ui->setupUi(this);
afterSetupUI();

// ignore the return key so we can better edit text in the table
setIgnoreReturnKey(true);
Expand Down
1 change: 1 addition & 0 deletions src/dialogs/tagadddialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

TagAddDialog::TagAddDialog(QWidget *parent) : MasterDialog(parent), ui(new Ui::TagAddDialog) {
ui->setupUi(this);
afterSetupUI();
ui->nameLineEdit->setFocus();
resize(1, 1);
}
Expand Down
1 change: 1 addition & 0 deletions src/dialogs/tododialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
TodoDialog::TodoDialog(const QString &taskUid, QWidget *parent)
: MasterDialog(parent), ui(new Ui::TodoDialog) {
ui->setupUi(this);
afterSetupUI();
setupUi();

connect(ui->todoItemTreeWidget, &TodoItemTreeWidget::calendarItemUpdated, this,
Expand Down
1 change: 1 addition & 0 deletions src/dialogs/trashdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
TrashDialog::TrashDialog(const QJSValue &notes, QWidget *parent)
: MasterDialog(parent), ui(new Ui::TrashDialog) {
ui->setupUi(this);
afterSetupUI();

// init the note browser search frame
ui->noteBrowser->initSearchFrame(ui->noteBrowserSearchFrame);
Expand Down
1 change: 1 addition & 0 deletions src/dialogs/updatedialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ UpdateDialog::UpdateDialog(QWidget *parent, const QString &changesHtml, const QS
const QString &releaseVersionString)
: MasterDialog(parent), ui(new Ui::UpdateDialog) {
ui->setupUi(this);
afterSetupUI();
ui->downloadProgressBar->hide();

#if !defined(Q_OS_WIN)
Expand Down
1 change: 1 addition & 0 deletions src/dialogs/versiondialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
VersionDialog::VersionDialog(const QJSValue &versions, QWidget *parent)
: MasterDialog(parent), ui(new Ui::VersionDialog) {
ui->setupUi(this);
afterSetupUI();
setWindowTitle(Utils::Misc::replaceOwnCloudText(windowTitle()));
ui->tabWidget->setCurrentIndex(0);

Expand Down
3 changes: 2 additions & 1 deletion src/dialogs/websockettokendialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@
#include "ui_websockettokendialog.h"

WebSocketTokenDialog::WebSocketTokenDialog(QWidget *parent)
: QDialog(parent), ui(new Ui::WebSocketTokenDialog) {
: MasterDialog(parent), ui(new Ui::WebSocketTokenDialog) {
ui->setupUi(this);
afterSetupUI();

QSettings settings;
QString token = settings.value(QStringLiteral("webSocketServerService/token")).toString();
Expand Down
4 changes: 3 additions & 1 deletion src/dialogs/websockettokendialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@

#include <QDialog>

#include "masterdialog.h"

namespace Ui {
class WebSocketTokenDialog;
}

class WebSocketTokenDialog : public QDialog {
class WebSocketTokenDialog : public MasterDialog {
Q_OBJECT

public:
Expand Down
1 change: 1 addition & 0 deletions src/dialogs/welcomedialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

WelcomeDialog::WelcomeDialog(QWidget *parent) : MasterDialog(parent), ui(new Ui::WelcomeDialog) {
ui->setupUi(this);
afterSetupUI();
ui->layoutWidget->setManualSettingsStoring(false);

// replace ownCloud text
Expand Down

0 comments on commit b246c66

Please sign in to comment.