@@ -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
}
@@ -1387,6 +1387,7 @@ func (p *Panel) initMainWindow(
1387
1387
}
1388
1388
p .streamTitleField = widget .NewEntry ()
1389
1389
p .streamTitleField .SetPlaceHolder ("stream title" )
1390
+ p .streamTitleField .Wrapping = fyne .TextWrapWord
1390
1391
p .streamTitleField .OnChanged = func (s string ) {
1391
1392
if len (s ) > youtubeTitleLength {
1392
1393
p .streamTitleField .SetText (s [:youtubeTitleLength ])
@@ -1400,6 +1401,35 @@ func (p *Panel) initMainWindow(
1400
1401
p .startStopButton .OnTapped ()
1401
1402
p .startStopButton .OnTapped ()
1402
1403
}
1404
+ p .streamTitleLabel = widget .NewLabel ("" )
1405
+ p .streamTitleLabel .Wrapping = fyne .TextWrapWord
1406
+ streamTitleButton := widget .NewButtonWithIcon ("" , theme .SettingsIcon (), func () {
1407
+ f := widget .NewMultiLineEntry ()
1408
+ f .SetText (p .streamTitleField .Text )
1409
+ f .Wrapping = fyne .TextWrapWord
1410
+ w := p .app .NewWindow ("title edit" )
1411
+ w .SetContent (container .NewBorder (
1412
+ nil ,
1413
+ container .NewBorder (
1414
+ nil ,
1415
+ nil ,
1416
+ widget .NewButtonWithIcon ("Cancel" , theme .DocumentSaveIcon (), func () {
1417
+ w .Close ()
1418
+ }),
1419
+ widget .NewButtonWithIcon ("Save" , theme .DocumentSaveIcon (), func () {
1420
+ f .Text = strings .ReplaceAll (f .Text , "\n " , " " )
1421
+ f .Text = f .Text [:youtubeTitleLength ]
1422
+ p .streamTitleField .SetText (f .Text )
1423
+ p .streamTitleLabel .SetText (f .Text )
1424
+ w .Close ()
1425
+ }),
1426
+ ),
1427
+ nil ,
1428
+ nil ,
1429
+ f ,
1430
+ ))
1431
+ w .Show ()
1432
+ })
1403
1433
1404
1434
p .streamDescriptionField = widget .NewMultiLineEntry ()
1405
1435
p .streamDescriptionField .SetPlaceHolder ("stream description" )
@@ -1411,6 +1441,41 @@ func (p *Panel) initMainWindow(
1411
1441
p .startStopButton .OnTapped ()
1412
1442
p .startStopButton .OnTapped ()
1413
1443
}
1444
+ p .streamDescriptionLabel = widget .NewLabel ("" )
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
+ } else {
1474
+ p .streamTitleLabel .Hide ()
1475
+ streamTitleButton .Hide ()
1476
+ p .streamDescriptionLabel .Hide ()
1477
+ streamDescriptionButton .Hide ()
1478
+ }
1414
1479
1415
1480
p .twitchCheck = widget .NewCheck ("Twitch" , nil )
1416
1481
p .twitchCheck .SetChecked (true )
@@ -1433,8 +1498,27 @@ func (p *Panel) initMainWindow(
1433
1498
})
1434
1499
1435
1500
bottomPanel := container .NewVBox (
1436
- container .NewBorder (nil , nil , regenerateTitleButton , nil , p .streamTitleField ),
1437
- container .NewBorder (nil , nil , regenerateDescriptionButton , nil , p .streamDescriptionField ),
1501
+ container .NewBorder (
1502
+ nil , nil ,
1503
+ regenerateTitleButton , nil ,
1504
+ container .NewStack (
1505
+ p .streamTitleField ,
1506
+ container .NewBorder (
1507
+ nil , nil , streamTitleButton , nil ,
1508
+ container .NewHScroll (p .streamTitleLabel ),
1509
+ )),
1510
+ ),
1511
+ container .NewBorder (
1512
+ nil , nil ,
1513
+ regenerateDescriptionButton , nil ,
1514
+ container .NewStack (
1515
+ p .streamDescriptionField ,
1516
+ container .NewBorder (
1517
+ nil , nil , streamDescriptionButton , nil ,
1518
+ //container.NewHScroll(p.streamDescriptionLabel),
1519
+ ),
1520
+ ),
1521
+ ),
1438
1522
container .NewBorder (
1439
1523
nil ,
1440
1524
nil ,
0 commit comments