mirror of
https://gitee.com/vnotex/vnote.git
synced 2025-07-05 13:59:52 +08:00
refine QFormLayout policy for VSearcher on macOS
This commit is contained in:
parent
4174055574
commit
f8717465c3
@ -26,6 +26,7 @@
|
||||
#include <QWebEngineView>
|
||||
#include <QAction>
|
||||
#include <QTreeWidgetItem>
|
||||
#include <QFormLayout>
|
||||
|
||||
#include "vorphanfile.h"
|
||||
#include "vnote.h"
|
||||
@ -1514,3 +1515,15 @@ QPixmap VUtils::pixmapFromFile(const QString &p_filePath)
|
||||
qDebug() << "pixmapFromFile" << p_filePath << pixmap.isNull();
|
||||
return pixmap;
|
||||
}
|
||||
|
||||
QFormLayout *VUtils::getFormLayout()
|
||||
{
|
||||
QFormLayout *layout = new QFormLayout();
|
||||
|
||||
#if defined(Q_OS_MACOS) || defined(Q_OS_MAC)
|
||||
layout->setFieldGrowthPolicy(QFormLayout::AllNonFixedFieldsGrow);
|
||||
layout->setFormAlignment(Qt::AlignLeft | Qt::AlignTop);
|
||||
#endif
|
||||
|
||||
return layout;
|
||||
}
|
||||
|
@ -20,6 +20,7 @@ class QComboBox;
|
||||
class QWebEngineView;
|
||||
class QAction;
|
||||
class QTreeWidgetItem;
|
||||
class QFormLayout;
|
||||
|
||||
#if !defined(V_ASSERT)
|
||||
#define V_ASSERT(cond) ((!(cond)) ? qt_assert(#cond, __FILE__, __LINE__) : qt_noop())
|
||||
@ -327,6 +328,9 @@ public:
|
||||
|
||||
static QPixmap pixmapFromFile(const QString &p_filePath);
|
||||
|
||||
// Return QFormLayout.
|
||||
static QFormLayout *getFormLayout();
|
||||
|
||||
// Regular expression for image link.
|
||||
// 
|
||||
// Captured texts (need to be trimmed):
|
||||
|
@ -171,7 +171,7 @@ void VSearcher::setupUI()
|
||||
m_fuzzyCB->setEnabled(!checked);
|
||||
});
|
||||
|
||||
QFormLayout *advLayout = new QFormLayout();
|
||||
QFormLayout *advLayout = VUtils::getFormLayout();
|
||||
advLayout->addRow(tr("File pattern:"), m_filePatternCB);
|
||||
advLayout->addRow(tr("Engine:"), m_searchEngineCB);
|
||||
advLayout->addRow(m_caseSensitiveCB);
|
||||
@ -226,7 +226,7 @@ void VSearcher::setupUI()
|
||||
updateNumLabel(p_count);
|
||||
});
|
||||
|
||||
QFormLayout *formLayout = new QFormLayout();
|
||||
QFormLayout *formLayout = VUtils::getFormLayout();
|
||||
formLayout->addRow(tr("Keywords:"), m_keywordCB);
|
||||
formLayout->addRow(tr("Scope:"), m_searchScopeCB);
|
||||
formLayout->addRow(tr("Object:"), m_searchObjectCB);
|
||||
|
Loading…
x
Reference in New Issue
Block a user