Skip to content

Commit

Permalink
Display app version somewhere
Browse files Browse the repository at this point in the history
resolves #77
  • Loading branch information
prolic committed Feb 20, 2025
1 parent 6db2a72 commit 422eab8
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 0 deletions.
22 changes: 22 additions & 0 deletions resources/qml/content/HomeScreen.ui.qml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,28 @@ Item {
}
}
}

Rectangle {
Layout.fillWidth: true
height: 30
color: Material.backgroundColor

Rectangle {
width: parent.width
height: 1
color: Material.dividerColor
anchors.top: parent.top
}

Text {
anchors.right: parent.right
anchors.bottom: parent.bottom
anchors.margins: 10
text: version
font: Constants.smallFont
color: Material.secondaryTextColor
}
}
}

RelayMgmtDialog {
Expand Down
9 changes: 9 additions & 0 deletions resources/qml/content/KeyMgmtScreen.ui.qml
Original file line number Diff line number Diff line change
Expand Up @@ -176,4 +176,13 @@ Rectangle {
ImportSuccessDialog {
id: importSuccessDialog
}

Text {
anchors.right: parent.right
anchors.bottom: parent.bottom
anchors.margins: 10
text: version
font: Constants.smallFont
color: Material.secondaryTextColor
}
}
2 changes: 2 additions & 0 deletions src/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ data AppState = AppState
, currentContact :: (Maybe PubKeyXO, Maybe SubscriptionId)
, currentProfile :: Maybe PubKeyXO
, currentPost :: Maybe EventId
, version :: Text
}


Expand Down Expand Up @@ -169,4 +170,5 @@ initialState = AppState
, currentContact = (Nothing, Nothing)
, currentProfile = Nothing
, currentPost = Nothing
, version = "v0.2.3-dev"
}
5 changes: 5 additions & 0 deletions src/UI.hs
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,11 @@ runUI = interpret $ \_ -> \case
chatPool <- newFactoryPool (newObject postClass)

rootClass <- newClass [
defPropertyConst' "version" (\_ -> do
st <- runE $ get @AppState
return $ version st
),

defPropertyConst' "ctxKeyMgmt" (\_ -> return keyMgmtObj),

defPropertyConst' "ctxRelayMgmt" (\_ -> return relayMgmtObj),
Expand Down

0 comments on commit 422eab8

Please sign in to comment.