Fix App Opener widget
This commit is contained in:
@@ -66,6 +66,7 @@ void LineTool::processImage(
|
||||
void LineTool::onPressed() {
|
||||
}
|
||||
|
||||
// Have to force horizontal position
|
||||
bool LineTool::needsAdjustment(const QPoint &p0, const QPoint &p1) const {
|
||||
return (p1.y() >= p0.y() - ADJ_VALUE) && (p1.y() <= p0.y() + ADJ_VALUE);
|
||||
}
|
||||
|
||||
@@ -68,6 +68,7 @@ void MarkerTool::processImage(
|
||||
void MarkerTool::onPressed() {
|
||||
}
|
||||
|
||||
// Have to force horizontal position
|
||||
bool MarkerTool::needsAdjustment(const QPoint &p0, const QPoint &p1) const {
|
||||
return (p1.y() >= p0.y() - ADJ_VALUE) && (p1.y() <= p0.y() + ADJ_VALUE);
|
||||
}
|
||||
|
||||
@@ -68,6 +68,7 @@ AppLauncherWidget::AppLauncherWidget(const QPixmap &p, QWidget *parent):
|
||||
listView->setSpacing(4);
|
||||
listView->setFlow(QListView::LeftToRight);
|
||||
listView->setDragEnabled(false);
|
||||
listView->setMinimumSize(375, 210);
|
||||
|
||||
for (auto app: appList) {
|
||||
QListWidgetItem *buttonItem = new QListWidgetItem(listView);
|
||||
|
||||
@@ -59,5 +59,5 @@ QSize launcherItemDelegate::sizeHint(
|
||||
{
|
||||
Q_UNUSED(option);
|
||||
Q_UNUSED(index);
|
||||
return QSize(100, 100);
|
||||
return QSize(110, 115);
|
||||
}
|
||||
|
||||
@@ -23,8 +23,12 @@
|
||||
|
||||
DesktopFileParse::DesktopFileParse() {
|
||||
QString locale = QLocale().name();
|
||||
QString localeShort = QLocale().name().left(2);
|
||||
m_localeName = QString("Name[%1]").arg(locale);
|
||||
m_localeDescription = QString("Comment[%1]").arg(locale);
|
||||
m_localeNameShort = QString("Name[%1]").arg(localeShort);
|
||||
m_localeDescriptionShort = QString("Comment[%1]")
|
||||
.arg(localeShort);
|
||||
}
|
||||
|
||||
DesktopAppData DesktopFileParse::parseDesktopFile(
|
||||
@@ -49,7 +53,9 @@ DesktopAppData DesktopFileParse::parseDesktopFile(
|
||||
line.mid(line.indexOf("=")+1).trimmed());
|
||||
}
|
||||
else if (!nameLocaleSet && line.startsWith("Name")) {
|
||||
if (line.startsWith(m_localeName)) {
|
||||
if (line.startsWith(m_localeName) ||
|
||||
line.startsWith(m_localeNameShort))
|
||||
{
|
||||
res.name = line.mid(line.indexOf("=")+1).trimmed();
|
||||
nameLocaleSet = true;
|
||||
} else if (line.startsWith("Name=")) {
|
||||
@@ -57,7 +63,9 @@ DesktopAppData DesktopFileParse::parseDesktopFile(
|
||||
}
|
||||
}
|
||||
else if (!descriptionLocaleSet && line.startsWith("Comment")) {
|
||||
if (line.startsWith(m_localeName)) {
|
||||
if (line.startsWith(m_localeDescription) ||
|
||||
line.startsWith(m_localeDescriptionShort))
|
||||
{
|
||||
res.description = line.mid(line.indexOf("=")+1).trimmed();
|
||||
descriptionLocaleSet = true;
|
||||
} else if (line.startsWith("Comment=")) {
|
||||
|
||||
@@ -38,6 +38,8 @@ struct DesktopFileParse {
|
||||
private:
|
||||
QString m_localeName;
|
||||
QString m_localeDescription;
|
||||
QString m_localeNameShort;
|
||||
QString m_localeDescriptionShort;
|
||||
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user