mirror of
https://github.com/overte-org/overte.git
synced 2025-08-04 14:29:35 +02:00
Adding lambdas and removing dead code
This commit is contained in:
parent
054e12a315
commit
03c10d15e6
3 changed files with 13 additions and 43 deletions
|
@ -37,10 +37,6 @@ DialogContainer {
|
|||
implicitWidth: backgroundImage.width
|
||||
implicitHeight: backgroundImage.height
|
||||
|
||||
onParentChanged: {
|
||||
console.log("Test: " + addressBarDialog.backEnabled + " " + addressBarDialog.forwardEnabled + " " + addressBarDialog)
|
||||
}
|
||||
|
||||
Image {
|
||||
id: backgroundImage
|
||||
|
||||
|
@ -70,15 +66,6 @@ DialogContainer {
|
|||
addressBarDialog.loadBack()
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Connections {
|
||||
target: backArrow
|
||||
onBackState: {
|
||||
parent.source: "../images/redarrow.svg"
|
||||
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
Image {
|
||||
|
@ -101,14 +88,6 @@ DialogContainer {
|
|||
addressBarDialog.loadForward()
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Connections {
|
||||
target: forwardArrow
|
||||
onForwardState: {
|
||||
parent.source: "../images/redarrow.svg"
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
TextInput {
|
||||
|
@ -148,6 +127,7 @@ DialogContainer {
|
|||
}
|
||||
}
|
||||
|
||||
// Add this code to make text bar draggable
|
||||
/*
|
||||
MouseArea {
|
||||
// Drag the input rectangle
|
||||
|
|
|
@ -22,8 +22,18 @@ 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, &AddressBarDialog::changeBackAlpha);
|
||||
connect(addressManager.data(), &AddressManager::goForwardPossible, this, &AddressBarDialog::changeForwardAlpha);
|
||||
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>()->getBackState();
|
||||
_forwardEnabled = DependencyManager::get<AddressManager>()->getForwardState();
|
||||
}
|
||||
|
@ -32,24 +42,6 @@ void AddressBarDialog::hide() {
|
|||
((QQuickItem*)parent())->setEnabled(false);
|
||||
}
|
||||
|
||||
void AddressBarDialog::changeBackAlpha(bool isPossible) {
|
||||
if (isPossible) qDebug() << "Back is possible";
|
||||
else qDebug() << "Back is not possible";
|
||||
if (isPossible != _backEnabled) {
|
||||
_backEnabled = isPossible;
|
||||
emit backEnabledChanged();
|
||||
}
|
||||
}
|
||||
|
||||
void AddressBarDialog::changeForwardAlpha(bool isPossible) {
|
||||
if (isPossible) qDebug() << "Forward is possible";
|
||||
else qDebug() << "Forward is not possible";
|
||||
if (isPossible != _forwardEnabled) {
|
||||
_forwardEnabled = isPossible;
|
||||
emit forwardEnabledChanged();
|
||||
}
|
||||
}
|
||||
|
||||
void AddressBarDialog::loadAddress(const QString& address) {
|
||||
qDebug() << "Called LoadAddress with address " << address;
|
||||
if (!address.isEmpty()) {
|
||||
|
|
|
@ -34,8 +34,6 @@ protected:
|
|||
void displayAddressOfflineMessage();
|
||||
void displayAddressNotFoundMessage();
|
||||
void hide();
|
||||
void changeBackAlpha(bool isPossible);
|
||||
void changeForwardAlpha(bool isPossible);
|
||||
|
||||
Q_INVOKABLE void loadAddress(const QString& address);
|
||||
Q_INVOKABLE void loadBack();
|
||||
|
|
Loading…
Reference in a new issue