mirror of
https://invent.kde.org/network/falkon.git
synced 2024-09-22 02:02:10 +02:00
[LocationBar] Option to always show go icon.
Also removed unused m_drawCursor member variable. Closes #914
This commit is contained in:
parent
0e478a56d8
commit
05ca29715f
|
@ -24,7 +24,6 @@ GoIcon::GoIcon(QWidget* parent)
|
|||
{
|
||||
setObjectName("locationbar-goicon");
|
||||
setCursor(Qt::PointingHandCursor);
|
||||
setHidden(true);
|
||||
}
|
||||
|
||||
void GoIcon::contextMenuEvent(QContextMenuEvent* ev)
|
||||
|
|
|
@ -56,7 +56,6 @@ LocationBar::LocationBar(QupZilla* mainClass)
|
|||
, m_progressVisible(false)
|
||||
, m_forcePaintEvent(false)
|
||||
, m_inlineCompletionVisible(false)
|
||||
, m_drawCursor(true)
|
||||
, m_popupClosed(false)
|
||||
{
|
||||
setObjectName("locationbar");
|
||||
|
@ -77,9 +76,9 @@ LocationBar::LocationBar(QupZilla* mainClass)
|
|||
addWidget(m_siteIcon, LineEdit::LeftSide);
|
||||
|
||||
addWidget(m_autofillIcon, LineEdit::RightSide);
|
||||
addWidget(m_goIcon, LineEdit::RightSide);
|
||||
addWidget(m_bookmarkIcon, LineEdit::RightSide);
|
||||
addWidget(m_rssIcon, LineEdit::RightSide);
|
||||
addWidget(m_goIcon, LineEdit::RightSide);
|
||||
addWidget(down, LineEdit::RightSide);
|
||||
|
||||
m_completer.setLocationBar(this);
|
||||
|
@ -100,7 +99,7 @@ LocationBar::LocationBar(QupZilla* mainClass)
|
|||
updatePlaceHolderText();
|
||||
|
||||
// Hide icons by default
|
||||
m_goIcon->hide();
|
||||
hideGoButton();
|
||||
m_rssIcon->hide();
|
||||
m_autofillIcon->hide();
|
||||
}
|
||||
|
@ -148,7 +147,6 @@ void LocationBar::completionPopupClosed()
|
|||
{
|
||||
m_inlineCompletionVisible = false;
|
||||
m_popupClosed = true;
|
||||
m_drawCursor = true;
|
||||
}
|
||||
|
||||
QUrl LocationBar::createUrl()
|
||||
|
@ -220,20 +218,11 @@ void LocationBar::textEdit()
|
|||
m_completer.closePopup();
|
||||
}
|
||||
|
||||
// Decide whether to draw cursor
|
||||
if (text().length() <= 1 && m_drawCursor && !m_popupClosed) {
|
||||
m_drawCursor = false;
|
||||
}
|
||||
|
||||
showGoButton();
|
||||
}
|
||||
|
||||
void LocationBar::showGoButton()
|
||||
{
|
||||
if (m_goIcon->isVisible()) {
|
||||
return;
|
||||
}
|
||||
|
||||
m_rssIconVisible = m_rssIcon->isVisible();
|
||||
|
||||
m_bookmarkIcon->hide();
|
||||
|
@ -245,13 +234,12 @@ void LocationBar::showGoButton()
|
|||
|
||||
void LocationBar::hideGoButton()
|
||||
{
|
||||
if (!m_goIcon->isVisible()) {
|
||||
return;
|
||||
}
|
||||
|
||||
m_rssIcon->setVisible(m_rssIconVisible);
|
||||
m_bookmarkIcon->show();
|
||||
m_goIcon->hide();
|
||||
|
||||
if (!qzSettings->alwaysShowGoIcon) {
|
||||
m_goIcon->hide();
|
||||
}
|
||||
|
||||
updateTextMargins();
|
||||
}
|
||||
|
|
|
@ -126,7 +126,6 @@ private:
|
|||
|
||||
bool m_forcePaintEvent;
|
||||
bool m_inlineCompletionVisible;
|
||||
bool m_drawCursor;
|
||||
bool m_popupClosed;
|
||||
};
|
||||
|
||||
|
|
|
@ -33,6 +33,7 @@ void QzSettings::loadSettings()
|
|||
showLoadingProgress = settings.value("ShowLoadingProgress", false).toBool();
|
||||
showLocationSuggestions = settings.value("showSuggestions", 0).toInt();
|
||||
showSwitchTab = settings.value("showSwitchTab", true).toBool();
|
||||
alwaysShowGoIcon = settings.value("alwaysShowGoIcon", false).toBool();
|
||||
settings.endGroup();
|
||||
|
||||
settings.beginGroup("SearchEngines");
|
||||
|
|
|
@ -38,6 +38,7 @@ public:
|
|||
bool showLoadingProgress;
|
||||
int showLocationSuggestions;
|
||||
bool showSwitchTab;
|
||||
bool alwaysShowGoIcon;
|
||||
|
||||
// SearchEngines
|
||||
bool showSearchSuggestions;
|
||||
|
|
|
@ -221,6 +221,7 @@ Preferences::Preferences(QupZilla* mainClass, QWidget* parent)
|
|||
settings.beginGroup("AddressBar");
|
||||
ui->addressbarCompletion->setCurrentIndex(settings.value("showSuggestions", 0).toInt());
|
||||
ui->completionShowSwitchTab->setChecked(settings.value("showSwitchTab", true).toBool());
|
||||
ui->alwaysShowGoIcon->setChecked(settings.value("alwaysShowGoIcon", false).toBool());
|
||||
ui->selectAllOnFocus->setChecked(settings.value("SelectAllTextOnDoubleClick", true).toBool());
|
||||
ui->selectAllOnClick->setChecked(settings.value("SelectAllTextOnClick", false).toBool());
|
||||
ui->addCountryWithAlt->setChecked(settings.value("AddCountryDomainWithAltKey", true).toBool());
|
||||
|
@ -971,6 +972,7 @@ void Preferences::saveSettings()
|
|||
//AddressBar
|
||||
settings.beginGroup("AddressBar");
|
||||
settings.setValue("showSuggestions", ui->addressbarCompletion->currentIndex());
|
||||
settings.setValue("alwaysShowGoIcon", ui->alwaysShowGoIcon->isChecked());
|
||||
settings.setValue("showSwitchTab", ui->completionShowSwitchTab->isChecked());
|
||||
settings.setValue("SelectAllTextOnDoubleClick", ui->selectAllOnFocus->isChecked());
|
||||
settings.setValue("SelectAllTextOnClick", ui->selectAllOnClick->isChecked());
|
||||
|
|
|
@ -140,8 +140,8 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>602</width>
|
||||
<height>469</height>
|
||||
<width>608</width>
|
||||
<height>485</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||
|
@ -843,6 +843,13 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="alwaysShowGoIcon">
|
||||
<property name="text">
|
||||
<string>Always show go icon</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="selectAllOnFocus">
|
||||
<property name="text">
|
||||
|
|
Loading…
Reference in New Issue
Block a user