Skip to content

Commit

Permalink
A bit of polishing of the main window user-interface
Browse files Browse the repository at this point in the history
Reorder the context menu of the table header and use separators for
coherent grouping: column actions, misc and encoding.

Set buttons invisible in the DB Structure toolbar when the object is
different to the supported ones. Disabling wasn't enough because the logic
for changing icon and text wasn't working well for fields and other items.

Separate Print from object actions in that same toolbar.

New icon for Project Save so it uses the same metaphor (floppy disk) as
other save actions.

Improved the look in the clear filters icon by editing it in gimp. It had
a glitch in the funnel base.
  • Loading branch information
mgrojo committed Sep 29, 2018
1 parent 071f963 commit f42b614
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 5 deletions.
17 changes: 13 additions & 4 deletions src/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -233,13 +233,14 @@ void MainWindow::init()

popupBrowseDataHeaderMenu = new QMenu(this);
popupBrowseDataHeaderMenu->addAction(ui->actionShowRowidColumn);
popupBrowseDataHeaderMenu->addAction(ui->actionHideColumns);
popupBrowseDataHeaderMenu->addAction(ui->actionShowAllColumns);
popupBrowseDataHeaderMenu->addSeparator();
popupBrowseDataHeaderMenu->addAction(ui->actionUnlockViewEditing);
popupBrowseDataHeaderMenu->addAction(ui->actionBrowseTableEditDisplayFormat);
popupBrowseDataHeaderMenu->addAction(ui->actionSetTableEncoding);
popupBrowseDataHeaderMenu->addSeparator();
popupBrowseDataHeaderMenu->addAction(ui->actionSetTableEncoding);
popupBrowseDataHeaderMenu->addAction(ui->actionSetAllTablesEncoding);
popupBrowseDataHeaderMenu->addAction(ui->actionHideColumns);
popupBrowseDataHeaderMenu->addAction(ui->actionShowAllColumns);

QShortcut* dittoRecordShortcut = new QShortcut(QKeySequence("Ctrl+\""), this);
connect(dittoRecordShortcut, &QShortcut::activated, [this]() {
Expand Down Expand Up @@ -1744,11 +1745,19 @@ void MainWindow::changeTreeSelection()
} else if(type == "index") {
ui->editDeleteObjectAction->setText(tr("Delete Index"));
ui->editModifyObjectAction->setText(tr("Modify Index"));
} else {
} else if(type == "table") {
ui->editDeleteObjectAction->setText(tr("Delete Table"));
ui->editModifyObjectAction->setText(tr("Modify Table"));
} else {
// Nothing to do for other types. Set the buttons not visible and return.
ui->editDeleteObjectAction->setVisible(false);
ui->editModifyObjectAction->setVisible(false);
return;
}

ui->editDeleteObjectAction->setVisible(true);
ui->editModifyObjectAction->setVisible(true);

// Activate actions
if(type == "table" || type == "index")
{
Expand Down
1 change: 1 addition & 0 deletions src/MainWindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
<addaction name="editCreateIndexAction"/>
<addaction name="editModifyObjectAction"/>
<addaction name="editDeleteObjectAction"/>
<addaction name="separator"/>
<addaction name="actionDbPrint"/>
</widget>
</item>
Expand Down
Binary file modified src/icons/clear_filters.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion src/icons/icons.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
<file alias="up">bullet_arrow_up.png</file>
<file alias="appicon">sqlitebrowser.png</file>
<file alias="browser_open">internet-web-browser.png</file>
<file alias="project_save">package.png</file>
<file>package.png</file>
<file alias="project_open">package_go.png</file>
<file alias="field_key">page_key.png</file>
<file alias="encryption">key.png</file>
Expand Down Expand Up @@ -67,5 +67,6 @@
<file alias="db_attach">database_link.png</file>
<file alias="text_indent">text_indent.png</file>
<file alias="print">printer.png</file>
<file alias="project_save">package_save.png</file>
</qresource>
</RCC>
Binary file added src/icons/package_save.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit f42b614

Please sign in to comment.