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 <QWebEngineView>
|
||||||
#include <QAction>
|
#include <QAction>
|
||||||
#include <QTreeWidgetItem>
|
#include <QTreeWidgetItem>
|
||||||
|
#include <QFormLayout>
|
||||||
|
|
||||||
#include "vorphanfile.h"
|
#include "vorphanfile.h"
|
||||||
#include "vnote.h"
|
#include "vnote.h"
|
||||||
@ -1514,3 +1515,15 @@ QPixmap VUtils::pixmapFromFile(const QString &p_filePath)
|
|||||||
qDebug() << "pixmapFromFile" << p_filePath << pixmap.isNull();
|
qDebug() << "pixmapFromFile" << p_filePath << pixmap.isNull();
|
||||||
return pixmap;
|
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 QWebEngineView;
|
||||||
class QAction;
|
class QAction;
|
||||||
class QTreeWidgetItem;
|
class QTreeWidgetItem;
|
||||||
|
class QFormLayout;
|
||||||
|
|
||||||
#if !defined(V_ASSERT)
|
#if !defined(V_ASSERT)
|
||||||
#define V_ASSERT(cond) ((!(cond)) ? qt_assert(#cond, __FILE__, __LINE__) : qt_noop())
|
#define V_ASSERT(cond) ((!(cond)) ? qt_assert(#cond, __FILE__, __LINE__) : qt_noop())
|
||||||
@ -327,6 +328,9 @@ public:
|
|||||||
|
|
||||||
static QPixmap pixmapFromFile(const QString &p_filePath);
|
static QPixmap pixmapFromFile(const QString &p_filePath);
|
||||||
|
|
||||||
|
// Return QFormLayout.
|
||||||
|
static QFormLayout *getFormLayout();
|
||||||
|
|
||||||
// Regular expression for image link.
|
// Regular expression for image link.
|
||||||
// 
|
// 
|
||||||
// Captured texts (need to be trimmed):
|
// Captured texts (need to be trimmed):
|
||||||
|
@ -171,7 +171,7 @@ void VSearcher::setupUI()
|
|||||||
m_fuzzyCB->setEnabled(!checked);
|
m_fuzzyCB->setEnabled(!checked);
|
||||||
});
|
});
|
||||||
|
|
||||||
QFormLayout *advLayout = new QFormLayout();
|
QFormLayout *advLayout = VUtils::getFormLayout();
|
||||||
advLayout->addRow(tr("File pattern:"), m_filePatternCB);
|
advLayout->addRow(tr("File pattern:"), m_filePatternCB);
|
||||||
advLayout->addRow(tr("Engine:"), m_searchEngineCB);
|
advLayout->addRow(tr("Engine:"), m_searchEngineCB);
|
||||||
advLayout->addRow(m_caseSensitiveCB);
|
advLayout->addRow(m_caseSensitiveCB);
|
||||||
@ -226,7 +226,7 @@ void VSearcher::setupUI()
|
|||||||
updateNumLabel(p_count);
|
updateNumLabel(p_count);
|
||||||
});
|
});
|
||||||
|
|
||||||
QFormLayout *formLayout = new QFormLayout();
|
QFormLayout *formLayout = VUtils::getFormLayout();
|
||||||
formLayout->addRow(tr("Keywords:"), m_keywordCB);
|
formLayout->addRow(tr("Keywords:"), m_keywordCB);
|
||||||
formLayout->addRow(tr("Scope:"), m_searchScopeCB);
|
formLayout->addRow(tr("Scope:"), m_searchScopeCB);
|
||||||
formLayout->addRow(tr("Object:"), m_searchObjectCB);
|
formLayout->addRow(tr("Object:"), m_searchObjectCB);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user