@@ -84,7 +84,9 @@ type Panel struct {
84
84
startStopButton * widget.Button
85
85
profilesListWidget * widget.List
86
86
streamTitleField * widget.Entry
87
+ streamTitleLabel * widget.Label
87
88
streamDescriptionField * widget.Entry
89
+ streamDescriptionLabel * widget.Label
88
90
89
91
dashboardLocker xsync.Mutex
90
92
dashboardShowHideButton * widget.Button
@@ -1127,19 +1129,17 @@ func resizeWindow(w fyne.Window, newSize fyne.Size) {
1127
1129
}
1128
1130
1129
1131
func setupStreamString () string {
1130
- switch runtime .GOOS {
1131
- case "android" :
1132
+ if isMobile () {
1132
1133
return "Set!"
1133
- default :
1134
+ } else {
1134
1135
return "Setup stream"
1135
1136
}
1136
1137
}
1137
1138
1138
1139
func startStreamString () string {
1139
- switch runtime .GOOS {
1140
- case "android" :
1140
+ if isMobile () {
1141
1141
return "Go!"
1142
- default :
1142
+ } else {
1143
1143
return "Start stream"
1144
1144
}
1145
1145
}
@@ -1400,6 +1400,35 @@ func (p *Panel) initMainWindow(
1400
1400
p .startStopButton .OnTapped ()
1401
1401
p .startStopButton .OnTapped ()
1402
1402
}
1403
+ p .streamTitleLabel = widget .NewLabel ("" )
1404
+ p .streamTitleLabel .Wrapping = fyne .TextWrapWord
1405
+ streamTitleButton := widget .NewButtonWithIcon ("" , theme .SettingsIcon (), func () {
1406
+ f := widget .NewMultiLineEntry ()
1407
+ f .SetText (p .streamTitleField .Text )
1408
+ f .Wrapping = fyne .TextWrapWord
1409
+ w := p .app .NewWindow ("title edit" )
1410
+ w .SetContent (container .NewBorder (
1411
+ nil ,
1412
+ container .NewBorder (
1413
+ nil ,
1414
+ nil ,
1415
+ widget .NewButtonWithIcon ("Cancel" , theme .DocumentSaveIcon (), func () {
1416
+ w .Close ()
1417
+ }),
1418
+ widget .NewButtonWithIcon ("Save" , theme .DocumentSaveIcon (), func () {
1419
+ f .Text = strings .ReplaceAll (f .Text , "\n " , " " )
1420
+ f .Text = f .Text [:youtubeTitleLength ]
1421
+ p .streamTitleField .SetText (f .Text )
1422
+ p .streamTitleLabel .SetText (f .Text )
1423
+ w .Close ()
1424
+ }),
1425
+ ),
1426
+ nil ,
1427
+ nil ,
1428
+ f ,
1429
+ ))
1430
+ w .Show ()
1431
+ })
1403
1432
1404
1433
p .streamDescriptionField = widget .NewMultiLineEntry ()
1405
1434
p .streamDescriptionField .SetPlaceHolder ("stream description" )
@@ -1411,6 +1440,41 @@ func (p *Panel) initMainWindow(
1411
1440
p .startStopButton .OnTapped ()
1412
1441
p .startStopButton .OnTapped ()
1413
1442
}
1443
+ p .streamDescriptionLabel = widget .NewLabel ("" )
1444
+ p .streamDescriptionLabel .Wrapping = fyne .TextWrapWord
1445
+ streamDescriptionButton := widget .NewButtonWithIcon ("" , theme .SettingsIcon (), func () {
1446
+ f := widget .NewMultiLineEntry ()
1447
+ f .SetText (p .streamDescriptionField .Text )
1448
+ f .Wrapping = fyne .TextWrapWord
1449
+ w := p .app .NewWindow ("title edit" )
1450
+ w .SetContent (container .NewBorder (
1451
+ nil ,
1452
+ container .NewBorder (
1453
+ nil ,
1454
+ nil ,
1455
+ widget .NewButtonWithIcon ("Cancel" , theme .DocumentSaveIcon (), func () {
1456
+ w .Close ()
1457
+ }),
1458
+ widget .NewButtonWithIcon ("Save" , theme .DocumentSaveIcon (), func () {
1459
+ p .streamDescriptionField .SetText (f .Text )
1460
+ p .streamDescriptionLabel .SetText (f .Text )
1461
+ w .Close ()
1462
+ }),
1463
+ ),
1464
+ nil ,
1465
+ nil ,
1466
+ f ,
1467
+ ))
1468
+ w .Show ()
1469
+ })
1470
+
1471
+ if isMobile () {
1472
+ p .streamTitleField .Hide ()
1473
+ p .streamDescriptionField .Hide ()
1474
+ } else {
1475
+ p .streamTitleLabel .Hide ()
1476
+ p .streamDescriptionLabel .Hide ()
1477
+ }
1414
1478
1415
1479
p .twitchCheck = widget .NewCheck ("Twitch" , nil )
1416
1480
p .twitchCheck .SetChecked (true )
@@ -1433,8 +1497,27 @@ func (p *Panel) initMainWindow(
1433
1497
})
1434
1498
1435
1499
bottomPanel := container .NewVBox (
1436
- container .NewBorder (nil , nil , regenerateTitleButton , nil , p .streamTitleField ),
1437
- container .NewBorder (nil , nil , regenerateDescriptionButton , nil , p .streamDescriptionField ),
1500
+ container .NewBorder (
1501
+ nil , nil ,
1502
+ regenerateTitleButton , nil ,
1503
+ container .NewStack (
1504
+ p .streamTitleField ,
1505
+ container .NewBorder (
1506
+ nil , nil , streamTitleButton , nil ,
1507
+ container .NewHScroll (p .streamTitleLabel ),
1508
+ )),
1509
+ ),
1510
+ container .NewBorder (
1511
+ nil , nil ,
1512
+ regenerateDescriptionButton , nil ,
1513
+ container .NewStack (
1514
+ p .streamDescriptionField ,
1515
+ container .NewBorder (
1516
+ nil , nil , streamDescriptionButton , nil ,
1517
+ container .NewHScroll (p .streamDescriptionLabel ),
1518
+ ),
1519
+ ),
1520
+ ),
1438
1521
container .NewBorder (
1439
1522
nil ,
1440
1523
nil ,
0 commit comments