Repository: nuttyartist/notes
File: src/mainwindow.cpp (C++)

Code before:
}

/*!
 * \brief MainWindow::onDotsButtonClicked
 * Open up the menu when clicking the 3 dots button
 */
void MainWindow::onDotsButtonClicked()
{
    m_dotsButton->setIcon(QIcon(QStringLiteral(":/images/3dots_Regular.png")));

    QMenu mainMenu;
    QMenu* viewMenu = mainMenu.addMenu(tr("View"));
    QMenu* importExportNotesMenu = mainMenu.addMenu(tr("Import/Export Notes"));
    importExportNotesMenu->setToolTipsVisible(true);
    viewMenu->setToolTipsVisible(true);
    mainMenu.setToolTipsVisible(true);

    /*mainMenu.setStyleSheet(QStringLiteral(
                               "QMenu { "
                               "  background-color: rgb(255, 255, 255); "
                               "  border: 1px solid #C7C7C7; "
                               "  }"
                               "QMenu::item:selected { "
                               "  background: 1px solid #308CC6; "
                               "}")
                           );*/

#ifdef __APPLE__
    mainMenu.setFont(QFont(QStringLiteral("Helvetica Neue"), 13));
    viewMenu->setFont(QFont(QStringLiteral("Helvetica Neue"), 13));
    importExportNotesMenu->setFont(QFont(QStringLiteral("Helvetica Neue"), 13));
#else
    mainMenu.setFont(QFont(QStringLiteral("Roboto"), 10, QFont::Normal));
    viewMenu->setFont(QFont(QStringLiteral("Roboto"), 10, QFont::Normal));
    importExportNotesMenu->setFont(QFont(QStringLiteral("Roboto"), 10, QFont::Normal));
#endif

    // note list visiblity action
    bool isCollapsed = (m_splitter->sizes().at(0) == 0);
    QString actionLabel = isCollapsed? tr("Show notes list")
                                     : tr("Hide notes list");

    QAction* noteListVisbilityAction = viewMenu->addAction(actionLabel);
    noteListVisbilityAction->setShortcut(Qt::CTRL + Qt::Key_J);
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
    noteListVisbilityAction->setShortcutVisibleInContextMenu(true);
#endif
    if(isCollapsed){
        connect(noteListVisbilityAction, &QAction::triggered, this, &MainWindow::expandNoteList);
    }else{
        connect(noteListVisbilityAction, &QAction::triggered, this, &MainWindow::collapseNoteList);

Review comment (bug):
Yes, I think this is also an improvement on Linux where the popup looked a bit broken with this stylesheet as well:

![image](https://user-images.githubusercontent.com/531764/87817580-7f3c4900-c869-11ea-9b4f-0a9bb93f6bb7.png)

The checkmark is too small, and it looks better without stylesheet (actually you couldn't see which items where checkable before, see the "Start automatically" option):

![image](https://user-images.githubusercontent.com/531764/87817633-98dd9080-c869-11ea-8496-ecc18ea1fcbf.png)

It will depend on the platform style, but I think that's a good thing.

I would only suggest that you remove these lines, instead of commenting them out.

Code after:
}

/*!
 * \brief MainWindow::onDotsButtonClicked
 * Open up the menu when clicking the 3 dots button
 */
void MainWindow::onDotsButtonClicked()
{
    m_dotsButton->setIcon(QIcon(QStringLiteral(":/images/3dots_Regular.png")));

    QMenu mainMenu;
    QMenu* viewMenu = mainMenu.addMenu(tr("View"));
    QMenu* importExportNotesMenu = mainMenu.addMenu(tr("Import/Export Notes"));
    importExportNotesMenu->setToolTipsVisible(true);
    viewMenu->setToolTipsVisible(true);
    mainMenu.setToolTipsVisible(true);

#ifdef __APPLE__
    mainMenu.setFont(QFont(QStringLiteral("Helvetica Neue"), 13));
    viewMenu->setFont(QFont(QStringLiteral("Helvetica Neue"), 13));
    importExportNotesMenu->setFont(QFont(QStringLiteral("Helvetica Neue"), 13));
#else
    mainMenu.setFont(QFont(QStringLiteral("Roboto"), 10, QFont::Normal));
    viewMenu->setFont(QFont(QStringLiteral("Roboto"), 10, QFont::Normal));
    importExportNotesMenu->setFont(QFont(QStringLiteral("Roboto"), 10, QFont::Normal));
#endif

    // note list visiblity action
    bool isCollapsed = (m_splitter->sizes().at(0) == 0);
    QString actionLabel = isCollapsed? tr("Show notes list")
                                     : tr("Hide notes list");

    QAction* noteListVisbilityAction = viewMenu->addAction(actionLabel);
    noteListVisbilityAction->setShortcut(Qt::CTRL + Qt::Key_J);
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
    noteListVisbilityAction->setShortcutVisibleInContextMenu(true);
#endif
    if(isCollapsed){
        connect(noteListVisbilityAction, &QAction::triggered, this, &MainWindow::expandNoteList);
    }else{
        connect(noteListVisbilityAction, &QAction::triggered, this, &MainWindow::collapseNoteList);
    }

    // Check for update action
    QAction* checkForUpdatesAction = mainMenu.addAction(tr("Check For Updates"));
    connect (checkForUpdatesAction, &QAction::triggered, this, &MainWindow::checkForUpdates);

    // Autostart
    QAction* autostartAction = mainMenu.addAction(tr("Start automatically"));
    connect (autostartAction, &QAction::triggered, this, [&]() {
        m_autostart.setAutostart(autostartAction->isChecked());