mirror of
https://github.com/overte-org/overte.git
synced 2025-04-21 17:03:58 +02:00
Address bar polish
This commit is contained in:
parent
cd325f7bf4
commit
1be303e3ed
4 changed files with 59 additions and 1 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 |
|
@ -30,6 +30,12 @@ DialogContainer {
|
|||
property int maximumX: parent ? parent.width - width : 0
|
||||
property int maximumY: parent ? parent.height - height : 0
|
||||
|
||||
|
||||
function myQmlFunction(msg) {
|
||||
console.log("Got message:", msg)
|
||||
return "some return value"
|
||||
}
|
||||
|
||||
AddressBarDialog {
|
||||
id: addressBarDialog
|
||||
|
||||
|
@ -49,7 +55,6 @@ DialogContainer {
|
|||
id: backArrow
|
||||
|
||||
source: "../images/left-arrow.svg"
|
||||
scale: 0.9
|
||||
|
||||
anchors {
|
||||
fill: parent
|
||||
|
@ -66,6 +71,13 @@ DialogContainer {
|
|||
addressBarDialog.loadBack()
|
||||
}
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: addressBarDialog
|
||||
onGoBackPossible: {
|
||||
console.log("ayy lmao BACK")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Image {
|
||||
|
@ -88,6 +100,13 @@ DialogContainer {
|
|||
addressBarDialog.loadForward()
|
||||
}
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: addressBarDialog
|
||||
onGoForwardPossible: {
|
||||
console.log("ayy lmao FORWARD")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
TextInput {
|
||||
|
|
|
@ -22,12 +22,38 @@ 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);
|
||||
}
|
||||
|
||||
void AddressBarDialog::hide() {
|
||||
((QQuickItem*)parent())->setEnabled(false);
|
||||
}
|
||||
|
||||
void AddressBarDialog::changeBackAlpha(bool isPossible) {
|
||||
if (isPossible) qDebug() << "Back is possible";
|
||||
else qDebug() << "Back is not possible";
|
||||
}
|
||||
|
||||
void AddressBarDialog::changeForwardAlpha(bool isPossible) {
|
||||
if (isPossible) qDebug() << "Forward is possible";
|
||||
else qDebug() << "Forward is not possible";
|
||||
|
||||
QQmlEngine engine;
|
||||
QQmlComponent component(&engine, "AddressBarDialog.qml");
|
||||
QObject *object = component.create();
|
||||
qDebug() << "AAAAAAAAAAAAAA : " << ((QQuickItem*)parent())->children()[0]->objectName();
|
||||
|
||||
QVariant returnedValue;
|
||||
QVariant msg = "Hello from C++";
|
||||
QMetaObject::invokeMethod(object, "myQmlFunction",
|
||||
Q_RETURN_ARG(QVariant, returnedValue),
|
||||
Q_ARG(QVariant, msg));
|
||||
|
||||
qDebug() << "QML function returned:" << returnedValue.toString();
|
||||
delete object;;
|
||||
}
|
||||
|
||||
void AddressBarDialog::loadAddress(const QString& address) {
|
||||
qDebug() << "Called LoadAddress with address " << address;
|
||||
if (!address.isEmpty()) {
|
||||
|
|
|
@ -26,6 +26,8 @@ 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