[LocationBar] Option to always show go icon.

Also removed unused m_drawCursor member variable.
Closes #914
remotes/origin/falkon
nowrep 13 years ago
parent 0e478a56d8
commit 05ca29715f
  1. 1
      src/lib/navigation/goicon.cpp
  2. 24
      src/lib/navigation/locationbar.cpp
  3. 1
      src/lib/navigation/locationbar.h
  4. 1
      src/lib/other/qzsettings.cpp
  5. 1
      src/lib/other/qzsettings.h
  6. 2
      src/lib/preferences/preferences.cpp
  7. 11
      src/lib/preferences/preferences.ui

@ -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…
Cancel
Save