Introduce new button type 'DYNAMIC' for PATH suggestions

Fixes #23
This commit is contained in:
Albert S. 2020-10-08 22:50:25 +02:00
rodzic f9038f3098
commit bb74d156c9
3 zmienionych plików z 5 dodań i 2 usunięć

Wyświetl plik

@ -19,7 +19,8 @@ enum EntryType
{
USER,
INHERIT,
SYSTEM
SYSTEM,
DYNAMIC
};
class EntryConfig

Wyświetl plik

@ -106,7 +106,7 @@ void EntryPushButton::mousePressEvent(QMouseEvent *event)
{
this->userEntryMenu.exec(QCursor::pos());
}
else
else if(this->config.type == EntryType::SYSTEM)
{
this->systemEntryMenu.exec(QCursor::pos());
}

Wyświetl plik

@ -266,6 +266,7 @@ void Window::addPATHSuggestion(const QString &text)
e.row = 0;
e.command = suggestions[0];
e.iconPath = suggestions[0];
e.type = EntryType::DYNAMIC;
EntryPushButton *button = createEntryButton(e);
clearGrid();
grid->addWidget(button, 0, 0);
@ -343,6 +344,7 @@ void Window::lineEditTextChanged(QString text)
}
e.command = arguments[0];
e.iconPath = "utilities-terminal";
e.type = EntryType::DYNAMIC;
EntryPushButton *button = createEntryButton(e);
clearGrid();