Changeset View
Changeset View
Standalone View
Standalone View
addons/search/plugin_search.cpp
Context not available. | |||||
222 | m_searchDiskFilesDone(true), | 222 | m_searchDiskFilesDone(true), | ||
---|---|---|---|---|---|
223 | m_searchOpenFilesDone(true), | 223 | m_searchOpenFilesDone(true), | ||
224 | m_isSearchAsYouType(false), | 224 | m_isSearchAsYouType(false), | ||
225 | m_isLeftRight(false), | ||||
225 | m_projectPluginView(nullptr), | 226 | m_projectPluginView(nullptr), | ||
226 | m_mainWindow (mainWin) | 227 | m_mainWindow (mainWin) | ||
227 | { | 228 | { | ||
Context not available. | |||||
1991 | searchPlaceChanged(); | 1992 | searchPlaceChanged(); | ||
1992 | } | 1993 | } | ||
1993 | 1994 | | |||
1995 | void KatePluginSearchView::onResize(const QSize& size) | ||||
1996 | { | ||||
1997 | bool vertical = size.width() < size.height(); | ||||
1998 | // empty last column index | ||||
1999 | const int col = 10; | ||||
2000 | | ||||
2001 | if(!m_isLeftRight && vertical) { | ||||
2002 | m_isLeftRight = true; | ||||
2003 | // move widgets to their own row | ||||
2004 | m_ui.gridLayout->addWidget(m_ui.findLabel, 2, 0); | ||||
2005 | m_ui.gridLayout->addWidget(m_ui.searchCombo, 2, 1, 1, col); | ||||
2006 | m_ui.gridLayout->addWidget(m_ui.replaceLabel, 3, 0); | ||||
2007 | m_ui.gridLayout->addWidget(m_ui.replaceCombo, 3, 1, 1, col); | ||||
2008 | m_ui.gridLayout->setColumnStretch(col, 2); | ||||
2009 | m_ui.gridLayout->setColumnStretch(2, 0); | ||||
2010 | } | ||||
2011 | else if(m_isLeftRight && !vertical) { | ||||
2012 | m_isLeftRight = false; | ||||
2013 | // move widgets back to their original place | ||||
2014 | m_ui.gridLayout->addWidget(m_ui.findLabel, 0, 1); | ||||
2015 | m_ui.gridLayout->addWidget(m_ui.searchCombo, 0, 2); | ||||
2016 | m_ui.gridLayout->addWidget(m_ui.replaceLabel, 1, 1); | ||||
2017 | m_ui.gridLayout->addWidget(m_ui.replaceCombo, 1, 2); | ||||
2018 | m_ui.gridLayout->setColumnStretch(col, 0); | ||||
2019 | m_ui.gridLayout->setColumnStretch(2, 2); | ||||
2020 | } | ||||
2021 | } | ||||
1994 | 2022 | | |||
1995 | bool KatePluginSearchView::eventFilter(QObject *obj, QEvent *event) | 2023 | bool KatePluginSearchView::eventFilter(QObject *obj, QEvent *event) | ||
1996 | { | 2024 | { | ||
Context not available. | |||||
2015 | } | 2043 | } | ||
2016 | // NOTE: Qt::Key_Escape is handled by handleEsc | 2044 | // NOTE: Qt::Key_Escape is handled by handleEsc | ||
2017 | } | 2045 | } | ||
2046 | if (event->type() == QEvent::Resize) { | ||||
2047 | QResizeEvent *re = static_cast<QResizeEvent*>(event); | ||||
2048 | if(obj == m_toolView) | ||||
2049 | { | ||||
2050 | onResize(re->size()); | ||||
2051 | } | ||||
2052 | } | ||||
2018 | return QObject::eventFilter(obj, event); | 2053 | return QObject::eventFilter(obj, event); | ||
2019 | } | 2054 | } | ||
2020 | 2055 | | |||
Context not available. |