This commit is contained in:
erinn 2019-02-13 18:53:36 -08:00
parent 5bdfc856a0
commit 454244934a
11 changed files with 21 additions and 18 deletions

View File

@ -1,9 +1,9 @@
<?xml version='1.0' encoding='utf-8'?> <?xml version='1.0' encoding='utf-8'?>
<manifest package="org.qtproject.example.go" xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="1.0" android:versionCode="1" android:installLocation="auto"> <manifest package="org.qtproject.example.go" xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="1.0" android:versionCode="1" android:installLocation="auto">
<application android:hardwareAccelerated="true" android:name="org.qtproject.qt5.android.bindings.QtApplication" android:label="cwtch"> <application android:hardwareAccelerated="true" android:name="org.qtproject.qt5.android.bindings.QtApplication" android:label="cwtch" android:icon="@drawable/ic_launcher">
<activity android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|layoutDirection|locale|fontScale|keyboard|keyboardHidden|navigation" <activity android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|layoutDirection|locale|fontScale|keyboard|keyboardHidden|navigation"
android:name="org.qtproject.qt5.android.bindings.QtActivity" android:name="org.qtproject.qt5.android.bindings.QtActivity"
android:label="go" android:label="cwtch"
android:screenOrientation="unspecified" android:screenOrientation="unspecified"
android:launchMode="singleTop"> android:launchMode="singleTop">
<intent-filter> <intent-filter>
@ -72,20 +72,10 @@
<uses-sdk android:minSdkVersion="16" android:targetSdkVersion="16"/> <uses-sdk android:minSdkVersion="16" android:targetSdkVersion="16"/>
<supports-screens android:largeScreens="true" android:normalScreens="true" android:anyDensity="true" android:smallScreens="true"/> <supports-screens android:largeScreens="true" android:normalScreens="true" android:anyDensity="true" android:smallScreens="true"/>
<!-- The following comment will be replaced upon deployment with default permissions based on the dependencies of the application.
Remove the comment if you do not require these default permissions. -->
<uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<!-- The following comment will be replaced upon deployment with default features based on the dependencies of the application.
Remove the comment if you do not require these default features. -->
<uses-feature android:name="android.hardware.camera" android:required="false" />
<uses-feature android:name="android.hardware.camera.autofocus" android:required="false" />
<uses-feature android:name="android.hardware.microphone" android:required="false" />
<uses-feature android:glEsVersion="0x00020000" android:required="true" /> <uses-feature android:glEsVersion="0x00020000" android:required="true" />
</manifest> </manifest>

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

View File

@ -403,6 +403,7 @@ func (this *GrandCentralDispatcher) createGroup(server, groupName string) {
}) })
group := the.Peer.GetGroup(groupID) group := the.Peer.GetGroup(groupID)
group.SetAttribute("nick", groupName)
the.CwtchApp.EventBus().Publish(event.NewEvent(event.SetGroupAttribute, map[event.Field]string{ the.CwtchApp.EventBus().Publish(event.NewEvent(event.SetGroupAttribute, map[event.Field]string{
event.GroupID: groupID, event.GroupID: groupID,
event.Key: "nick", event.Key: "nick",

13
main.go
View File

@ -18,6 +18,7 @@ import (
"os" "os"
"os/user" "os/user"
"path" "path"
"runtime"
) )
func init() { func init() {
@ -54,10 +55,20 @@ func main() {
engine := qml.NewQQmlApplicationEngine(nil) engine := qml.NewQQmlApplicationEngine(nil)
// variables we want to access from inside qml // variables we want to access from inside qml
if runtime.GOOS == "android" {
gcd.SetThemeScale(2.9)
} else {
gcd.SetThemeScale(1.0)
}
engine.RootContext().SetContextProperty("gcd", gcd) engine.RootContext().SetContextProperty("gcd", gcd)
engine.Load(qmlSource) engine.Load(qmlSource)
acn, err := connectivity.StartTor(the.CwtchDir, "") torpath := "tor"
if runtime.GOOS == "android" {
torpath = "/data/data/org.qtproject.example.go/lib/libtor.so"
}
acn, err := connectivity.StartTor(the.CwtchDir, torpath)
if err != nil { if err != nil {
log.Errorf("Could not start Tor: %v", err) log.Errorf("Could not start Tor: %v", err)
os.Exit(1) os.Exit(1)

View File

@ -29,12 +29,13 @@ ColumnLayout { // settingsPane
Slider { Slider {
id: zoomSlider id: zoomSlider
minimumValue: 0.5 minimumValue: 0.5
maximumValue: 2.4 maximumValue: 4.0
value: 1 value: gcd.themeScale
updateValueWhileDragging: false updateValueWhileDragging: false
onValueChanged: { onValueChanged: {
gcd.themeScale = zoomSlider.value gcd.themeScale = zoomSlider.value
} }
width: 400
} }
ScalingLabel { ScalingLabel {
@ -54,7 +55,7 @@ ColumnLayout { // settingsPane
}//end of column with padding }//end of column with padding
Component.onCompleted: { Component.onCompleted: {
zoomSlider.value = 1 //Screen.pixelDensity / 3.2 // artistic license. set by erinn. fight me before changing zoomSlider.value = gcd.themeScale //Screen.pixelDensity / 3.2 // artistic license. set by erinn. fight me before changing
if (zoomSlider.value < zoomSlider.from) zoomSlider.value = zoomSlider.from if (zoomSlider.value < zoomSlider.from) zoomSlider.value = zoomSlider.from
if (zoomSlider.value > zoomSlider.to) zoomSlider.value = zoomSlider.to if (zoomSlider.value > zoomSlider.to) zoomSlider.value = zoomSlider.to
} }

View File

@ -80,7 +80,7 @@ RowLayout {
visible: false visible: false
padding: 6 padding: 6
leftPadding: 10 leftPadding: 10
font.pixelSize: 12 font.pixelSize: gcd.themeScale * 12
wrapMode: TextEdit.NoWrap wrapMode: TextEdit.NoWrap
text: message text: message
textFormat: Text.RichText textFormat: Text.RichText
@ -91,7 +91,7 @@ RowLayout {
color: "#FFFFFF" color: "#FFFFFF"
padding: 6 padding: 6
leftPadding: 10 leftPadding: 10
font.pixelSize: 12 font.pixelSize: gcd.themeScale * 12
selectByMouse: true selectByMouse: true
readOnly: true readOnly: true
width: Math.min(dummy.width, root.parent.width - (imgProfile.visible ? imgProfile.width : 0) - 40) width: Math.min(dummy.width, root.parent.width - (imgProfile.visible ? imgProfile.width : 0) - 40)