@@ -100,16 +100,27 @@ public override void Main ()
100
100
{
101
101
X = Pos . Right ( lblDriverName ) + 2 ,
102
102
Y = 1 ,
103
- CheckedState = _sixelSupportResult . IsSupported
104
- ? CheckState . Checked
105
- : CheckState . UnChecked ,
103
+ CheckedState = CheckState . UnChecked ,
106
104
Text = "Supports Sixel"
107
105
} ;
108
106
107
+ var lblSupportsSixel = new Label ( )
108
+ {
109
+
110
+ X = Pos . Right ( lblDriverName ) + 2 ,
111
+ Y = Pos . Bottom ( cbSupportsSixel ) ,
112
+ Text = "(Check if your terminal supports Sixel)"
113
+ } ;
114
+
115
+
116
+ /* CheckedState = _sixelSupportResult.IsSupported
117
+ ? CheckState.Checked
118
+ : CheckState.UnChecked;*/
109
119
cbSupportsSixel . CheckedStateChanging += ( s , e ) =>
110
120
{
111
121
_sixelSupportResult . IsSupported = e . NewValue == CheckState . Checked ;
112
122
SetupSixelSupported ( e . NewValue == CheckState . Checked ) ;
123
+ ApplyShowTabViewHack ( ) ;
113
124
} ;
114
125
115
126
_win . Add ( cbSupportsSixel ) ;
@@ -130,7 +141,7 @@ public override void Main ()
130
141
131
142
_tabView = new ( )
132
143
{
133
- Y = Pos . Bottom ( btnOpenImage ) , Width = Dim . Fill ( ) , Height = Dim . Fill ( )
144
+ Y = Pos . Bottom ( lblSupportsSixel ) , Width = Dim . Fill ( ) , Height = Dim . Fill ( )
134
145
} ;
135
146
136
147
_tabView . AddTab ( tabBasic , true ) ;
@@ -143,6 +154,7 @@ public override void Main ()
143
154
144
155
btnOpenImage . Accepting += OpenImage ;
145
156
157
+ _win . Add ( lblSupportsSixel ) ;
146
158
_win . Add ( _tabView ) ;
147
159
Application . Run ( _win ) ;
148
160
_win . Dispose ( ) ;
@@ -275,9 +287,19 @@ private void OpenImage (object sender, CommandEventArgs e)
275
287
}
276
288
277
289
_imageView . SetImage ( img ) ;
290
+ ApplyShowTabViewHack ( ) ;
278
291
Application . Refresh ( ) ;
279
292
}
280
293
294
+ private void ApplyShowTabViewHack ( )
295
+ {
296
+ // TODO HACK: This hack seems to be required to make tabview actually refresh itself
297
+ _tabView . SetNeedsDisplay ( ) ;
298
+ var orig = _tabView . SelectedTab ;
299
+ _tabView . SelectedTab = _tabView . Tabs . Except ( new [ ] { orig } ) . ElementAt ( 0 ) ;
300
+ _tabView . SelectedTab = orig ;
301
+ }
302
+
281
303
private void BuildBasicTab ( Tab tabBasic )
282
304
{
283
305
_imageView = new ( )
0 commit comments