mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 03:24:00 +02:00
commit
cc45693f55
6 changed files with 54 additions and 3 deletions
11
interface/resources/images/redarrow.svg
Normal file
11
interface/resources/images/redarrow.svg
Normal file
|
@ -0,0 +1,11 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 18.1.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg version="1.1" id="Layer_1" xmlns:xl="http://www.w3.org/1999/xlink"
|
||||
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="133.1 714.2 21.3 33.4"
|
||||
enable-background="new 133.1 714.2 21.3 33.4" xml:space="preserve">
|
||||
<g>
|
||||
<g>
|
||||
<path fill="#FF5353" d="M133.1,714.2l21.3,16.7l-21.3,16.7V714.2z"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 501 B |
11
interface/resources/images/redarrow_reversed.svg
Normal file
11
interface/resources/images/redarrow_reversed.svg
Normal file
|
@ -0,0 +1,11 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 18.1.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg version="1.1" id="Layer_1" xmlns:xl="http://www.w3.org/1999/xlink"
|
||||
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="225.8 714.2 326.5 512"
|
||||
enable-background="new 225.8 714.2 326.5 512" xml:space="preserve">
|
||||
<g>
|
||||
<g>
|
||||
<path fill="#FF5353" d="M552.4,1226.2l-326.5-256l326.5-256V1226.2z"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 503 B |
|
@ -30,6 +30,7 @@ DialogContainer {
|
|||
property int maximumX: parent ? parent.width - width : 0
|
||||
property int maximumY: parent ? parent.height - height : 0
|
||||
|
||||
|
||||
AddressBarDialog {
|
||||
id: addressBarDialog
|
||||
|
||||
|
@ -48,8 +49,7 @@ DialogContainer {
|
|||
Image {
|
||||
id: backArrow
|
||||
|
||||
source: "../images/left-arrow.svg"
|
||||
scale: 0.9
|
||||
source: addressBarDialog.backEnabled ? "../images/left-arrow.svg" : "../images/redarrow_reversed.svg"
|
||||
|
||||
anchors {
|
||||
fill: parent
|
||||
|
@ -71,7 +71,7 @@ DialogContainer {
|
|||
Image {
|
||||
id: forwardArrow
|
||||
|
||||
source: "../images/darkgreyarrow.svg"
|
||||
source: addressBarDialog.forwardEnabled ? "../images/darkgreyarrow.svg" : "../images/redarrow.svg"
|
||||
|
||||
anchors {
|
||||
fill: parent
|
||||
|
@ -127,6 +127,7 @@ DialogContainer {
|
|||
}
|
||||
}
|
||||
|
||||
// Add this code to make text bar draggable
|
||||
/*
|
||||
MouseArea {
|
||||
// Drag the input rectangle
|
||||
|
|
|
@ -22,6 +22,20 @@ AddressBarDialog::AddressBarDialog(QQuickItem* parent) : OffscreenQmlDialog(pare
|
|||
connect(addressManager.data(), &AddressManager::lookupResultIsOffline, this, &AddressBarDialog::displayAddressOfflineMessage);
|
||||
connect(addressManager.data(), &AddressManager::lookupResultIsNotFound, this, &AddressBarDialog::displayAddressNotFoundMessage);
|
||||
connect(addressManager.data(), &AddressManager::lookupResultsFinished, this, &AddressBarDialog::hide);
|
||||
connect(addressManager.data(), &AddressManager::goBackPossible, this, [this] (bool isPossible) {
|
||||
if (isPossible != _backEnabled) {
|
||||
_backEnabled = isPossible;
|
||||
emit backEnabledChanged();
|
||||
}
|
||||
});
|
||||
connect(addressManager.data(), &AddressManager::goForwardPossible, this, [this] (bool isPossible) {
|
||||
if (isPossible != _forwardEnabled) {
|
||||
_forwardEnabled = isPossible;
|
||||
emit forwardEnabledChanged();
|
||||
}
|
||||
});
|
||||
_backEnabled = !(DependencyManager::get<AddressManager>()->getBackStack().isEmpty());
|
||||
_forwardEnabled = !(DependencyManager::get<AddressManager>()->getForwardStack().isEmpty());
|
||||
}
|
||||
|
||||
void AddressBarDialog::hide() {
|
||||
|
|
|
@ -18,9 +18,17 @@ class AddressBarDialog : public OffscreenQmlDialog
|
|||
{
|
||||
Q_OBJECT
|
||||
HIFI_QML_DECL
|
||||
Q_PROPERTY(bool backEnabled READ backEnabled NOTIFY backEnabledChanged)
|
||||
Q_PROPERTY(bool forwardEnabled READ forwardEnabled NOTIFY forwardEnabledChanged)
|
||||
|
||||
public:
|
||||
AddressBarDialog(QQuickItem* parent = nullptr);
|
||||
bool backEnabled() { return _backEnabled; }
|
||||
bool forwardEnabled() { return _forwardEnabled; }
|
||||
|
||||
signals:
|
||||
void backEnabledChanged();
|
||||
void forwardEnabledChanged();
|
||||
|
||||
protected:
|
||||
void displayAddressOfflineMessage();
|
||||
|
@ -30,6 +38,9 @@ protected:
|
|||
Q_INVOKABLE void loadAddress(const QString& address);
|
||||
Q_INVOKABLE void loadBack();
|
||||
Q_INVOKABLE void loadForward();
|
||||
|
||||
bool _backEnabled;
|
||||
bool _forwardEnabled;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -62,6 +62,9 @@ public:
|
|||
|
||||
void loadSettings(const QString& lookupString = QString());
|
||||
|
||||
const QStack<QUrl>& getBackStack() const { return _backStack; }
|
||||
const QStack<QUrl>& getForwardStack() const { return _forwardStack; }
|
||||
|
||||
public slots:
|
||||
void handleLookupString(const QString& lookupString);
|
||||
|
||||
|
|
Loading…
Reference in a new issue