Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MenuBar] placeholder txt, debug quit, enhance/debug menu widgets and color #1245

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion src/app/medInria/areas/homepage/medHomepageArea.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ void medHomepageArea::initPage()
medHomepageButton * browserButton = new medHomepageButton ( this );
browserButton->setToolButtonStyle ( Qt::ToolButtonTextBesideIcon );
browserButton->setIcon ( QIcon::fromTheme("open") );
browserButton->setText ( " Import/export files" );
browserButton->setText ( " Browse files" );
browserButton->setMinimumHeight ( 40 );
browserButton->setMaximumWidth ( 250 );
browserButton->setMinimumWidth ( 250 );
Expand Down
3 changes: 2 additions & 1 deletion src/app/medInria/medDatabaseDataSource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,9 @@ QWidget* medDatabaseDataSource::buildSourcesTreeViewList()

QVBoxLayout *layout = new QVBoxLayout();

auto filterLineEdit = new QLineEdit("Search...");
auto filterLineEdit = new QLineEdit();
filterLineEdit->setMaximumHeight(20);
filterLineEdit->setPlaceholderText("Search...");
connect(filterLineEdit, SIGNAL(textChanged(const QString &)), d->multiSources_tree, SIGNAL(filterProxy(const QString &)));

d->compactView = d->multiSources_tree->buildTree();
Expand Down
2 changes: 1 addition & 1 deletion src/app/medInria/medFileSystemDataSource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ medFileSystemDataSource::medFileSystemDataSource( QWidget* parent ): medAbstract

QAction *viewAction = new QAction(tr("View"), this);
viewAction->setIconVisibleInMenu(true);
viewAction->setIcon(QIcon::fromTheme("eye"));
viewAction->setIcon(QIcon::fromTheme("eye_opened"));

d->finder->addContextMenuAction(importAction);
d->finder->addContextMenuAction(viewAction);
Expand Down
120 changes: 68 additions & 52 deletions src/app/medInria/medMainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ medMainWindow::medMainWindow ( QWidget *parent ) : QMainWindow ( parent ), d ( n
d->homepageArea = new medHomepageArea( this );
d->homepageArea->setObjectName("medHomePageArea");


// Stack
d->stack = new QStackedWidget(this);
d->stack->addWidget(d->homepageArea);
Expand Down Expand Up @@ -170,7 +169,6 @@ medMainWindow::~medMainWindow()
d = nullptr;
}


void medMainWindow::initMenuBar(QWidget * parent)
{
// Menu bar
Expand Down Expand Up @@ -217,15 +215,28 @@ void medMainWindow::menuFile(QMenuBar * menu_bar)
{
// --- File menu
QMenu *menuFile = menu_bar->addMenu("File");
menuFile->setToolTipsVisible(true);

auto *actionOpenFiles = menuFile->addAction("Open File(s)");
auto *actionOpenDicom = menuFile->addAction("Open Dicom");
connect(actionOpenFiles, &QAction::triggered, this, &medMainWindow::openFromSystem);

auto *actionOpenDicom = menuFile->addAction("Open DICOM");
actionOpenDicom->setToolTip(tr("Choose a DICOM directory to import"));
connect(actionOpenDicom, &QAction::triggered, this, &medMainWindow::openDicomFromSystem);

menuFile->addAction("Save on disk");

auto *actionBrowse = menuFile->addAction("Browse files");
connect(actionBrowse, &QAction::triggered, this, &medMainWindow::switchToBrowserArea);

menuFile->addSeparator();
auto *actionGoHome = menuFile->addAction("Go to Welcome Page");
auto *actionGoHome = menuFile->addAction("Go to homepage");
connect(actionGoHome, &QAction::triggered, this, &medMainWindow::switchToHomepageArea);

menuFile->addSeparator();
menuFile->addMenu("Recent files");
menuFile->addSeparator();

auto *subMenuVisibilitySource = menuFile->addMenu("Source Visibility");

QAction *virtualReprAction = subMenuVisibilitySource->addAction("Quick Access");
Expand All @@ -244,31 +255,24 @@ void medMainWindow::menuFile(QMenuBar * menu_bar)
}

menuFile->addSeparator();
menuFile->addAction("Quit");

connect(actionOpenFiles, &QAction::triggered, this, &medMainWindow::openFromSystem);
connect(actionOpenDicom, &QAction::triggered, this, &medMainWindow::openDicomFromSystem);
connect(actionBrowse, &QAction::triggered, this, &medMainWindow::switchToBrowserArea);
connect(actionGoHome, &QAction::triggered, this, &medMainWindow::switchToHomepageArea);
QAction *actionQuit = menuFile->addAction(tr("Quit"));
connect(actionQuit, &QAction::triggered, qApp, &QApplication::quit);
}

void medMainWindow::menuWorkspace(QMenuBar * menu_bar)
{
// --- Area menu
QMenu *menuWorkspaces = menu_bar->addMenu("Workspaces");

//auto searchLabel = new QWidgetAction(menuWorkspaces);
auto searchEdit = new QWidgetAction(menuWorkspaces);
//searchLabel->setDefaultWidget(new QLabel("Search features you want below"));
QLineEdit * researchWorkSpace = new QLineEdit("Search here ...");
QLineEdit * researchWorkSpace = new QLineEdit();
researchWorkSpace->setPlaceholderText("Search...");
searchEdit->setDefaultWidget(researchWorkSpace);
//menuWorkspaces->addAction(searchLabel);
menuWorkspaces->addAction(searchEdit);
menuWorkspaces->addSeparator();

connect(researchWorkSpace, &QLineEdit::textEdited, this, &medMainWindow::filterWSMenu);


medToolBoxFactory *tbFactory = medToolBoxFactory::instance();
QList<medWorkspaceFactory::Details*> workspaceDetails = medWorkspaceFactory::instance()->workspaceDetailsSortedByName(true);

Expand Down Expand Up @@ -432,7 +436,7 @@ void medMainWindow::switchToDefaultWorkSpace()
{
switchToHomepageArea();
}
else if (startupWorkspace == "Import/export files")
else if (startupWorkspace == "Browse files")
{
switchToBrowserArea();
}
Expand Down Expand Up @@ -618,12 +622,6 @@ void medMainWindow::onShowDataSources()
dialog->exec();
}


//void medMainWindow::onShowNotifPanel()
//{
// d->notifWindow->swithVisibility();
//}

void medMainWindow::onShowAbout()
{
QFile file(":ABOUT.txt");
Expand All @@ -635,61 +633,79 @@ void medMainWindow::onShowAbout()
msgBox.exec();
}

/**
* @brief Display the application authors list in a widget.
*
*/
void medMainWindow::onShowAuthors()
{
QFile file(":authors.txt");
file.open(QIODevice::ReadOnly | QIODevice::Text);
QString text = file.readAll();

QMessageBox msgBox;
msgBox.setText(text);
msgBox.exec();
QDialog dialog;
dialog.setWindowTitle("Authors");

QVBoxLayout *layout = new QVBoxLayout(&dialog);
QTextEdit *textEdit = new QTextEdit(&dialog);
textEdit->setText(text);
textEdit->setReadOnly(true);
textEdit->setLineWrapMode(QTextEdit::WidgetWidth);
textEdit->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
layout->addWidget(textEdit);

dialog.resize(400, 300);
dialog.exec();
}

/**
* @brief Display the current release notes of the application in a widget.
*
*/
void medMainWindow::onShowReleaseNotes()
{
QFile file(":RELEASE_NOTES.txt");
file.open(QIODevice::ReadOnly | QIODevice::Text);
QString text = file.readAll();

QMessageBox msgBox;
msgBox.setText("Here is the release notes with the history of the application: ");
msgBox.setDetailedText(text);
QDialog dialog;
dialog.setWindowTitle("Release Notes");

// Search the "Show Details..." button
foreach(QAbstractButton *button, msgBox.buttons())
{
if (msgBox.buttonRole(button) == QMessageBox::ActionRole)
{
button->click(); // click it to expand the text
break;
}
}
QVBoxLayout *layout = new QVBoxLayout(&dialog);
QTextEdit *textEdit = new QTextEdit(&dialog);
textEdit->setText(text);
textEdit->setReadOnly(true);
textEdit->setLineWrapMode(QTextEdit::WidgetWidth);
textEdit->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
layout->addWidget(textEdit);

msgBox.exec();
dialog.resize(400, 300);
dialog.exec();
}

/**
* @brief Display the current license of the application in a widget.
*
*/
void medMainWindow::onShowLicense()
{
QFile file(":LICENSE.txt");
file.open(QIODevice::ReadOnly | QIODevice::Text);
QString text = file.readAll();

QMessageBox msgBox;
msgBox.setText("Here is the application License: ");
msgBox.setDetailedText(text);
QDialog dialog;
dialog.setWindowTitle("License");

// Search the "Show Details..." button
foreach(QAbstractButton *button, msgBox.buttons())
{
if (msgBox.buttonRole(button) == QMessageBox::ActionRole)
{
button->click(); // click it to expand the text
break;
}
}
QVBoxLayout *layout = new QVBoxLayout(&dialog);
QTextEdit *textEdit = new QTextEdit(&dialog);
textEdit->setText(text);
textEdit->setReadOnly(true);
textEdit->setLineWrapMode(QTextEdit::WidgetWidth);
textEdit->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
layout->addWidget(textEdit);

msgBox.exec();
dialog.resize(400, 300);
dialog.exec();
}

void medMainWindow::onShowAreaSettings()
Expand Down Expand Up @@ -978,7 +994,7 @@ void medMainWindow::switchToBrowserArea()
{
d->currentArea = d->browserArea;

d->shortcutAccessWidget->updateSelected("Import/export files");
d->shortcutAccessWidget->updateSelected("Browse files");
if (d->shortcutAccessVisible)
{
this->hideShortcutAccess();
Expand Down
1 change: 0 additions & 1 deletion src/app/medInria/medMainWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ public slots:
*/
void switchToDefaultWorkSpace();


/**
* @brief Switch visibility of notification panel
*/
Expand Down
4 changes: 2 additions & 2 deletions src/app/medInria/medQuickAccessMenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ int retrieveDefaultWorkSpace()
{
iRes = homepageDefaultWorkspaceNumber;
}
else if (oStartupWorkspace.toString() == "Import/export files")
else if (oStartupWorkspace.toString() == "Browse files")
{
iRes = 1;
}
Expand Down Expand Up @@ -363,7 +363,7 @@ void medQuickAccessMenu::createHorizontalQuickAccessMenu()
smallBrowserButton->setFixedHeight ( 100 );
smallBrowserButton->setFixedWidth ( 160 );
smallBrowserButton->setFocusPolicy ( Qt::NoFocus );
smallBrowserButton->setText("Import/export files");
smallBrowserButton->setText("Browse files");
smallBrowserButton->setIdentifier("Browser");
shortcutAccessLayout->addWidget ( smallBrowserButton );
QObject::connect ( smallBrowserButton, SIGNAL ( clicked() ), this, SIGNAL ( browserSelected()) );
Expand Down
10 changes: 4 additions & 6 deletions src/app/medInria/resources/dark.qss
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ $GREEN = #64FF32;
$RED = #FF3333;
$YELLOW = #FFFF99;
$ORANGE = #ED6639;
$WHITE = #F5F5F5;

$HIGHLIGHT_COLOR = #FF8833;

Expand All @@ -40,7 +41,7 @@ $HIGHLIGHT_COLOR = #FF8833;
*******************************************************************************/
$WIDGET_BACKGROUND = $GREY01;

$TOOLTIP_BACKGROUND = $YELLOW;
$TOOLTIP_BACKGROUND = $WHITE;

$LIST_BACKGROUND = $GREY02;
$ALT_LIST_BACKGROUND = $GREY03;
Expand Down Expand Up @@ -450,11 +451,8 @@ QCheckBox::indicator:disabled:checked
*******************************************************************************/
QTreeView
{
/* alternate-background-color: $ALT_LIST_BACKGROUND; */
alternate-background-color: $ALT_LIST_BACKGROUND;
background: $LIST_BACKGROUND;
/* background-color: $COMBO_BOX_ITEM_BACKGROUND; */
selection-background-color: $COMBO_BOX_ITEM_SELECTED_BACKGROUND;
selection-color: $COMBO_BOX_ITEM_SELECTED_COLOR;
}

QTreeView::item
Expand Down Expand Up @@ -1226,7 +1224,7 @@ medLinkMenu QListWidget::item
border: none;
}

medLinkMenu QListWidget::item:selected
QListWidget::item:selected
{
border: none;
background: $MENU_ITEM_HOVER_BACKGROUND;
Expand Down
2 changes: 1 addition & 1 deletion src/app/medInria/resources/grey.qss
Original file line number Diff line number Diff line change
Expand Up @@ -1269,7 +1269,7 @@ medLinkMenu QListWidget::item
border: none;
}

medLinkMenu QListWidget::item:selected
QListWidget::item:selected
{
border: none;
background: $MENU_ITEM_HOVER_BACKGROUND;
Expand Down
37 changes: 37 additions & 0 deletions src/app/medInria/resources/icons/arrow-bot-disabled.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading