]> gitweb.stoutner.com Git - PrivacyBrowserPC.git/commitdiff
Focus the bookmark name when adding or editing bookmarks. https://redmine.stoutner...
authorSoren Stoutner <soren@stoutner.com>
Fri, 29 Dec 2023 23:30:25 +0000 (16:30 -0700)
committerSoren Stoutner <soren@stoutner.com>
Fri, 29 Dec 2023 23:30:25 +0000 (16:30 -0700)
src/dialogs/AddBookmarkDialog.cpp
src/dialogs/EditBookmarkDialog.cpp
src/dialogs/EditFolderDialog.cpp

index 9f977afabdcfed2f8ece0e02b89499d5e4b01b40..4c91c2c2138f7a84b9f445341bde5ad616f5be46 100644 (file)
@@ -94,10 +94,12 @@ AddBookmarkDialog::AddBookmarkDialog(const QString &bookmarkName, const QString
     bookmarkNameLineEditPointer->setText(bookmarkName);
     bookmarkUrlLineEditPointer->setText(bookmarkUrl);
 
-    // Scroll to the beginning of the line edits.
-    bookmarkNameLineEditPointer->setCursorPosition(0);
+    // Scroll to the beginning of the bookmark URL line edit.
     bookmarkUrlLineEditPointer->setCursorPosition(0);
 
+    // Focus the bookmark name line edit.
+    bookmarkNameLineEditPointer->setFocus();
+
     // Add buttons to the dialog button box.
     addButtonPointer = dialogButtonBoxPointer->addButton(i18nc("The add bookmark button", "Add"), QDialogButtonBox::AcceptRole);
 
index 3a4d770eb740045e4891f8469e11f8110d7df0f8..a0c0c773dbbcf5d1e9e727b33f6d9d00b7162122 100644 (file)
@@ -96,10 +96,12 @@ EditBookmarkDialog::EditBookmarkDialog(const int databaseId, QIcon &currentWebsi
     bookmarkNameLineEditPointer->setText(bookmarkStructPointer->name);
     bookmarkUrlLineEditPointer->setText(bookmarkStructPointer->url);
 
-    // Scroll to the beginning of the line edits.
-    bookmarkNameLineEditPointer->setCursorPosition(0);
+    // Scroll to the beginning of the bookmark URL line edit.
     bookmarkUrlLineEditPointer->setCursorPosition(0);
 
+    // Focus the bookmark name line edit.
+    bookmarkNameLineEditPointer->setFocus();
+
     // Connect the buttons.
     connect(browseButtonPointer, SIGNAL(clicked()), this, SLOT(browse()));
     connect(dialogButtonBoxPointer, SIGNAL(accepted()), this, SLOT(save()));
index eb2bdcf4d4f51212533e0acbb72c9c96a1606986..428544404a49dbb35ef1df1eb1e8b94f409b0dc6 100644 (file)
@@ -93,8 +93,8 @@ EditFolderDialog::EditFolderDialog(const int databaseId, QIcon &currentWebsiteFa
     // Populate the line edits.
     folderNameLineEditPointer->setText(bookmarkStructPointer->name);
 
-    // Scroll to the beginning of the line edits.
-    folderNameLineEditPointer->setCursorPosition(0);
+    // Focus the folder name line edit.
+    folderNameLineEditPointer->setFocus();
 
     // Connect the buttons.
     connect(browseButtonPointer, SIGNAL(clicked()), this, SLOT(browse()));