… | |
… | |
74 | sub harmonize { |
74 | sub harmonize { |
75 | my ($vals) = @_; |
75 | my ($vals) = @_; |
76 | |
76 | |
77 | my $rem = 0; |
77 | my $rem = 0; |
78 | |
78 | |
79 | for ($vals) { |
79 | for (@$vals) { |
80 | my $i = int $_ + $rem; |
80 | my $i = int $_ + $rem; |
81 | $rem += $_ - $i; |
81 | $rem += $_ - $i; |
82 | $_ = $i; |
82 | $_ = $i; |
83 | } |
83 | } |
84 | } |
84 | } |
… | |
… | |
112 | $self |
112 | $self |
113 | } |
113 | } |
114 | |
114 | |
115 | sub move { |
115 | sub move { |
116 | my ($self, $x, $y, $z) = @_; |
116 | my ($self, $x, $y, $z) = @_; |
117 | $self->{x} = $x; |
117 | $self->{x} = int $x; |
118 | $self->{y} = $y; |
118 | $self->{y} = int $y; |
119 | $self->{z} = $z if defined $z; |
119 | $self->{z} = $z if defined $z; |
120 | } |
120 | } |
121 | |
121 | |
122 | sub needs_redraw { |
122 | sub needs_redraw { |
123 | 0 |
123 | 0 |
… | |
… | |
176 | |
176 | |
177 | return if $FOCUS == $self; |
177 | return if $FOCUS == $self; |
178 | return unless $self->{can_focus}; |
178 | return unless $self->{can_focus}; |
179 | |
179 | |
180 | my $focus = $FOCUS; $FOCUS = $self; |
180 | my $focus = $FOCUS; $FOCUS = $self; |
|
|
181 | |
|
|
182 | $self->emit (focus_in => $focus); |
|
|
183 | |
181 | $focus->update if $focus; |
184 | $focus->update if $focus; |
182 | $FOCUS->update; |
185 | $FOCUS->update; |
183 | } |
186 | } |
184 | |
187 | |
185 | sub focus_out { |
188 | sub focus_out { |
186 | my ($self) = @_; |
189 | my ($self) = @_; |
187 | |
190 | |
188 | return unless $FOCUS == $self; |
191 | return unless $FOCUS == $self; |
189 | |
192 | |
190 | my $focus = $FOCUS; undef $FOCUS; |
193 | my $focus = $FOCUS; undef $FOCUS; |
|
|
194 | |
|
|
195 | $self->emit (focus_out => $focus); |
|
|
196 | |
191 | $focus->update if $focus; #? |
197 | $focus->update if $focus; #? |
192 | } |
198 | } |
193 | |
199 | |
194 | sub mouse_motion { } |
200 | sub mouse_motion { } |
195 | sub button_up { } |
201 | sub button_up { } |
… | |
… | |
219 | glPopMatrix; |
225 | glPopMatrix; |
220 | |
226 | |
221 | if ($self == $HOVER && $self->{can_hover}) { |
227 | if ($self == $HOVER && $self->{can_hover}) { |
222 | my ($x, $y) = @$self{qw(x y)}; |
228 | my ($x, $y) = @$self{qw(x y)}; |
223 | |
229 | |
224 | glColor 0, 0, 1, 0.2; |
230 | glColor 1, 0.8, 0.5, 0.2; |
225 | glEnable GL_BLEND; |
231 | glEnable GL_BLEND; |
226 | glBlendFunc GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA; |
232 | glBlendFunc GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA; |
227 | glBegin GL_QUADS; |
233 | glBegin GL_QUADS; |
228 | glVertex $x , $y; |
234 | glVertex $x , $y; |
229 | glVertex $x + $self->{w}, $y; |
235 | glVertex $x + $self->{w}, $y; |
… | |
… | |
565 | # TODO: user_x, user_y, overwrite moveto? |
571 | # TODO: user_x, user_y, overwrite moveto? |
566 | |
572 | |
567 | $class->SUPER::new ( |
573 | $class->SUPER::new ( |
568 | bg => [1, 1, 1, 1], |
574 | bg => [1, 1, 1, 1], |
569 | border_bg => [1, 1, 1, 1], |
575 | border_bg => [1, 1, 1, 1], |
570 | border => $::FONTSIZE * 0.8, |
576 | border => int $::FONTSIZE * 0.8, |
571 | @_ |
577 | @_ |
572 | ) |
578 | ) |
573 | } |
579 | } |
574 | |
580 | |
575 | sub size_request { |
581 | sub size_request { |
… | |
… | |
950 | my $self = $class->SUPER::new ( |
956 | my $self = $class->SUPER::new ( |
951 | fg => [1, 1, 1], |
957 | fg => [1, 1, 1], |
952 | fontsize => $::FONTSIZE, |
958 | fontsize => $::FONTSIZE, |
953 | text => "", |
959 | text => "", |
954 | align => -1, |
960 | align => -1, |
|
|
961 | valign => -1, |
955 | padding => 2, |
962 | padding => 2, |
956 | layout => new CFClient::Layout, |
963 | layout => new CFClient::Layout, |
957 | %arg |
964 | %arg |
958 | ); |
965 | ); |
959 | |
966 | |
960 | $self->set_text ($self->{text}); |
967 | $self->{xxx}++ if $self->{text} eq "Client Setup" && $self->{align};#d# |
|
|
968 | |
|
|
969 | $self->set_text (delete $self->{text}) if exists $self->{text}; |
|
|
970 | $self->set_markup (delete $self->{markup}) if exists $self->{markup}; |
961 | |
971 | |
962 | $self |
972 | $self |
963 | } |
973 | } |
964 | |
974 | |
965 | sub escape_text { |
975 | sub escape_text { |
… | |
… | |
973 | } |
983 | } |
974 | |
984 | |
975 | sub set_text { |
985 | sub set_text { |
976 | my ($self, $text) = @_; |
986 | my ($self, $text) = @_; |
977 | |
987 | |
978 | $self->{text} = $text; |
|
|
979 | $self->{layout}->set_markup ($text); |
988 | $self->{layout}->set_text ($text); |
980 | |
989 | |
981 | delete $self->{texture}; |
990 | delete $self->{texture}; |
982 | # $self->{w} = $self->{h} = -1; |
|
|
983 | $self->update; |
991 | $self->update; |
984 | } |
992 | } |
985 | |
993 | |
986 | sub get_text { |
994 | sub set_markup { |
987 | my ($self, $text) = @_; |
995 | my ($self, $markup) = @_; |
988 | |
996 | |
989 | $self->{text} |
997 | $self->{layout}->set_markup ($markup); |
|
|
998 | |
|
|
999 | delete $self->{texture}; |
|
|
1000 | $self->update; |
990 | } |
1001 | } |
991 | |
1002 | |
992 | sub size_request { |
1003 | sub size_request { |
993 | my ($self) = @_; |
1004 | my ($self) = @_; |
994 | |
1005 | |
995 | $self->{layout}->set_width; |
1006 | $self->{layout}->set_width; |
996 | $self->{layout}->set_height ($self->{fontsize}); |
1007 | $self->{layout}->set_height ($self->{fontsize}); |
|
|
1008 | |
997 | my ($w, $h) = $self->{layout}->size; |
1009 | my ($w, $h) = $self->{layout}->size; |
998 | |
1010 | |
999 | ( |
1011 | ( |
1000 | $w + $self->{padding} * 2, |
1012 | $w + $self->{padding} * 2, |
1001 | $h + $self->{padding} * 2, |
1013 | $h + $self->{padding} * 2, |
… | |
… | |
1020 | sub _draw { |
1032 | sub _draw { |
1021 | my ($self) = @_; |
1033 | my ($self) = @_; |
1022 | |
1034 | |
1023 | my $tex = $self->{texture} ||= do { |
1035 | my $tex = $self->{texture} ||= do { |
1024 | $self->{layout}->set_width ($self->{w}); |
1036 | $self->{layout}->set_width ($self->{w}); |
1025 | $self->{layout}->set_height (List::Util::min $self->{h} - $self->{padding} * 2, $self->{fontsize}); |
1037 | $self->{layout}->set_height (List::Util::min $self->{h}, $self->{fontsize}); |
1026 | new_from_layout CFClient::Texture $self->{layout} |
1038 | new_from_layout CFClient::Texture $self->{layout} |
1027 | }; |
1039 | }; |
1028 | |
1040 | |
1029 | glEnable GL_BLEND; |
1041 | glEnable GL_BLEND; |
1030 | glBlendFunc GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA; |
1042 | glBlendFunc GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA; |
1031 | glEnable GL_TEXTURE_2D; |
1043 | glEnable GL_TEXTURE_2D; |
1032 | glTexEnv GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE; |
1044 | glTexEnv GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE; |
1033 | |
1045 | |
1034 | glColor @{$self->{fg}}; |
1046 | glColor @{$self->{fg}}; |
1035 | |
1047 | |
1036 | my $x = |
1048 | $self->{ox} = int ( |
1037 | $self->{align} < 0 ? $self->{padding} |
1049 | $self->{align} < 0 ? $self->{padding} |
1038 | : $self->{align} > 0 ? $self->{w} - $tex->{w} - $self->{padding} |
1050 | : $self->{align} > 0 ? $self->{w} - $tex->{w} - $self->{padding} |
1039 | : ($self->{w} - $tex->{w}) * 0.5; |
1051 | : ($self->{w} - $tex->{w}) * 0.5 |
|
|
1052 | ); |
1040 | |
1053 | |
1041 | $tex->draw_quad (int $x, int +($self->{h} - $tex->{h}) * 0.5); |
1054 | $self->{oy} = int ( |
|
|
1055 | $self->{valign} < 0 ? $self->{padding} |
|
|
1056 | : $self->{valign} > 0 ? $self->{h} - $tex->{h} - $self->{padding} |
|
|
1057 | : ($self->{h} - $tex->{h}) * 0.5 |
|
|
1058 | ); |
|
|
1059 | |
|
|
1060 | $tex->draw_quad ($self->{ox}, $self->{oy}); |
1042 | |
1061 | |
1043 | glDisable GL_TEXTURE_2D; |
1062 | glDisable GL_TEXTURE_2D; |
1044 | glDisable GL_BLEND; |
1063 | glDisable GL_BLEND; |
1045 | } |
1064 | } |
1046 | |
1065 | |
1047 | ############################################################################# |
1066 | ############################################################################# |
1048 | |
1067 | |
1049 | package CFClient::UI::Entry; |
1068 | package CFClient::UI::EntryBase; |
1050 | |
1069 | |
1051 | our @ISA = CFClient::UI::Label::; |
1070 | our @ISA = CFClient::UI::Label::; |
1052 | |
1071 | |
1053 | use SDL; |
1072 | use SDL; |
1054 | use SDL::OpenGL; |
1073 | use SDL::OpenGL; |
… | |
… | |
1061 | bg => [0, 0, 0, 0.2], |
1080 | bg => [0, 0, 0, 0.2], |
1062 | active_bg => [1, 1, 1, 0.5], |
1081 | active_bg => [1, 1, 1, 0.5], |
1063 | active_fg => [0, 0, 0], |
1082 | active_fg => [0, 0, 0], |
1064 | can_hover => 1, |
1083 | can_hover => 1, |
1065 | can_focus => 1, |
1084 | can_focus => 1, |
|
|
1085 | valign => 0, |
1066 | @_ |
1086 | @_ |
1067 | ) |
1087 | ) |
1068 | } |
1088 | } |
1069 | |
1089 | |
1070 | sub _set_text { |
1090 | sub _set_text { |
1071 | my ($self, $text) = @_; |
1091 | my ($self, $text) = @_; |
1072 | |
1092 | |
1073 | my $old_text = $self->{text}; |
1093 | delete $self->{cur_h}; |
|
|
1094 | |
|
|
1095 | return if $self->{text} eq $text; |
1074 | |
1096 | |
1075 | $self->{last_activity} = $::NOW; |
1097 | $self->{last_activity} = $::NOW; |
1076 | |
|
|
1077 | $self->{text} = $text; |
1098 | $self->{text} = $text; |
1078 | $self->{layout}->set_width ($self->{w}); |
|
|
1079 | $self->{layout}->set_height (List::Util::min $self->{h} - $self->{padding} * 2, $self->{fontsize}); |
|
|
1080 | |
1099 | |
1081 | $text =~ s/./*/g if $self->{hidden}; |
1100 | $text =~ s/./*/g if $self->{hidden}; |
|
|
1101 | $self->{layout}->set_text ("$text "); |
1082 | |
1102 | |
1083 | $self->{layout}->set_markup ($self->escape_text ($text) . " "); |
1103 | $self->emit (changed => $self->{text}); |
|
|
1104 | } |
1084 | |
1105 | |
1085 | $text = substr $text, 0, $self->{cursor}; |
1106 | sub get_text { |
1086 | utf8::encode $text; |
1107 | $_[0]{text} |
1087 | |
|
|
1088 | @$self{qw(cur_x cur_y cur_h)} = $self->{layout}->cursor_pos (length $text); |
|
|
1089 | |
|
|
1090 | $self->emit (changed => $self->{text}) # XXX: is this the right place to do this? |
|
|
1091 | if $old_text ne $self->{text}; |
|
|
1092 | } |
1108 | } |
1093 | |
1109 | |
1094 | sub size_request { |
1110 | sub size_request { |
1095 | my ($self) = @_; |
1111 | my ($self) = @_; |
1096 | |
1112 | |
… | |
… | |
1200 | |
1216 | |
1201 | $self->SUPER::_draw; |
1217 | $self->SUPER::_draw; |
1202 | |
1218 | |
1203 | #TODO: force update every cursor change :( |
1219 | #TODO: force update every cursor change :( |
1204 | if ($FOCUS == $self && (($::NOW - $self->{last_activity}) & 1023) < 600) { |
1220 | if ($FOCUS == $self && (($::NOW - $self->{last_activity}) & 1023) < 600) { |
|
|
1221 | |
|
|
1222 | unless (exists $self->{cur_h}) { |
|
|
1223 | my $text = substr $self->{text}, 0, $self->{cursor}; |
|
|
1224 | utf8::encode $text; |
|
|
1225 | |
|
|
1226 | @$self{qw(cur_x cur_y cur_h)} = $self->{layout}->cursor_pos (length $text) |
|
|
1227 | } |
|
|
1228 | |
1205 | glColor @{$self->{fg}}; |
1229 | glColor @{$self->{fg}}; |
1206 | glBegin GL_LINES; |
1230 | glBegin GL_LINES; |
1207 | glVertex $self->{cur_x}, $self->{cur_y}; |
|
|
1208 | glVertex $self->{cur_x}, $self->{cur_y} + $self->{cur_h}; |
1231 | glVertex $self->{cur_x} + $self->{ox}, $self->{cur_y} + $self->{oy}; |
|
|
1232 | glVertex $self->{cur_x} + $self->{ox}, $self->{cur_y} + $self->{oy} + $self->{cur_h}; |
1209 | glEnd; |
1233 | glEnd; |
1210 | } |
1234 | } |
1211 | } |
1235 | } |
1212 | |
1236 | |
1213 | package CFClient::UI::LineEntry; |
1237 | package CFClient::UI::Entry; |
1214 | |
1238 | |
1215 | our @ISA = CFClient::UI::Entry::; |
1239 | our @ISA = CFClient::UI::EntryBase::; |
1216 | |
1240 | |
1217 | use SDL; |
1241 | use SDL; |
1218 | use SDL::OpenGL; |
1242 | use SDL::OpenGL; |
1219 | |
1243 | |
1220 | sub key_down { |
1244 | sub key_down { |
… | |
… | |
1269 | |
1293 | |
1270 | sub _draw { |
1294 | sub _draw { |
1271 | my ($self) = @_; |
1295 | my ($self) = @_; |
1272 | |
1296 | |
1273 | local $self->{fg} = $self->{fg}; |
1297 | local $self->{fg} = $self->{fg}; |
1274 | my $tex = $tex[0]; |
|
|
1275 | |
|
|
1276 | glEnable GL_BLEND; |
|
|
1277 | glEnable GL_TEXTURE_2D; |
|
|
1278 | glBlendFunc GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA; |
|
|
1279 | |
1298 | |
1280 | if ($GRAB == $self) { |
1299 | if ($GRAB == $self) { |
1281 | $self->{fg} = $self->{active_fg}; |
1300 | $self->{fg} = $self->{active_fg}; |
1282 | } |
1301 | } |
1283 | |
1302 | |
1284 | glBindTexture GL_TEXTURE_2D, $tex->{name}; |
1303 | glEnable GL_BLEND; |
|
|
1304 | glBlendFunc GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA; |
|
|
1305 | glEnable GL_TEXTURE_2D; |
1285 | glTexEnv GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE; |
1306 | glTexEnv GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE; |
|
|
1307 | glColor 0, 0, 0, 1; |
1286 | |
1308 | |
1287 | $tex->draw_quad (0, 0, $self->{w}, $self->{h}); |
1309 | $tex[0]->draw_quad (0, 0, $self->{w}, $self->{h}); |
1288 | |
1310 | |
1289 | glDisable GL_TEXTURE_2D; |
1311 | glDisable GL_TEXTURE_2D; |
1290 | glDisable GL_BLEND; |
1312 | glDisable GL_BLEND; |
1291 | |
1313 | |
1292 | $self->SUPER::_draw; |
1314 | $self->SUPER::_draw; |
… | |
… | |
1774 | 0.1, 0.1, 0.1, |
1796 | 0.1, 0.1, 0.1, |
1775 | ; |
1797 | ; |
1776 | glEnable GL_CONVOLUTION_2D; |
1798 | glEnable GL_CONVOLUTION_2D; |
1777 | } |
1799 | } |
1778 | |
1800 | |
1779 | my $tex = new CFClient::Texture |
1801 | $self->{fow_texture} = new CFClient::Texture |
1780 | w => $w, |
1802 | w => $w, |
1781 | h => $h, |
1803 | h => $h, |
1782 | data => $data, |
1804 | data => $data, |
1783 | internalformat => GL_ALPHA, |
1805 | internalformat => GL_ALPHA, |
1784 | format => GL_ALPHA; |
1806 | format => GL_ALPHA; |
… | |
… | |
1789 | glBlendFunc GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA; |
1811 | glBlendFunc GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA; |
1790 | glEnable GL_TEXTURE_2D; |
1812 | glEnable GL_TEXTURE_2D; |
1791 | glTexEnv GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE; |
1813 | glTexEnv GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE; |
1792 | |
1814 | |
1793 | glColor +($::CFG->{fow_intensity}) x 3, 1; |
1815 | glColor +($::CFG->{fow_intensity}) x 3, 1; |
1794 | $tex->draw_quad (0, 0, $w * 32, $h * 32); |
1816 | $self->{fow_texture}->draw_quad (0, 0, $w * 32, $h * 32); |
1795 | |
1817 | |
1796 | glDisable GL_TEXTURE_2D; |
1818 | glDisable GL_TEXTURE_2D; |
1797 | glDisable GL_BLEND; |
1819 | glDisable GL_BLEND; |
1798 | } |
1820 | } |
1799 | |
1821 | |
… | |
… | |
1805 | glEnable GL_BLEND; |
1827 | glEnable GL_BLEND; |
1806 | glBlendFunc GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA; |
1828 | glBlendFunc GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA; |
1807 | glEnable GL_TEXTURE_2D; |
1829 | glEnable GL_TEXTURE_2D; |
1808 | glTexEnv GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE; |
1830 | glTexEnv GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE; |
1809 | |
1831 | |
|
|
1832 | $self->{mapmap_texture} = |
1810 | CFClient::Texture->new ( |
1833 | new CFClient::Texture |
1811 | w => $w, |
1834 | w => $w, |
1812 | h => $h, |
1835 | h => $h, |
1813 | data => $::MAP->mapmap ($w, $h), |
1836 | data => $::MAP->mapmap ($w, $h), |
1814 | type => GL_UNSIGNED_INT_8_8_8_8_REV |
1837 | type => GL_UNSIGNED_INT_8_8_8_8_REV; |
1815 | )->draw_quad (100, 100); |
1838 | |
|
|
1839 | $self->{mapmap_texture}->draw_quad (100, 100); |
1816 | |
1840 | |
1817 | glDisable GL_TEXTURE_2D; |
1841 | glDisable GL_TEXTURE_2D; |
1818 | glDisable GL_BLEND; |
1842 | glDisable GL_BLEND; |
1819 | } |
1843 | } |
1820 | # HACK END |
1844 | # HACK END |
… | |
… | |
1862 | |
1886 | |
1863 | my $mod = $ev->key_mod; |
1887 | my $mod = $ev->key_mod; |
1864 | my $sym = $ev->key_sym; |
1888 | my $sym = $ev->key_sym; |
1865 | |
1889 | |
1866 | if ($sym == SDLK_KP5) { |
1890 | if ($sym == SDLK_KP5) { |
1867 | $::CONN->user_send ("command stay fire"); |
1891 | $::CONN->user_send ("stay fire"); |
1868 | } elsif ($sym == SDLK_a) { |
1892 | } elsif ($sym == SDLK_a) { |
1869 | $::CONN->user_send ("command apply"); |
1893 | $::CONN->user_send ("apply"); |
1870 | } elsif ($sym == SDLK_QUOTE) { |
1894 | } elsif ($sym == SDLK_QUOTE) { |
1871 | $self->emit ('activate_console'); |
1895 | $self->emit ('activate_console'); |
1872 | } elsif ($sym == SDLK_SLASH) { |
1896 | } elsif ($sym == SDLK_SLASH) { |
1873 | $self->emit ('activate_console' => '/'); |
1897 | $self->emit ('activate_console' => '/'); |
1874 | } elsif (exists $DIR{$sym}) { |
1898 | } elsif (exists $DIR{$sym}) { |
1875 | if ($mod & KMOD_SHIFT) { |
1899 | if ($mod & KMOD_SHIFT) { |
1876 | $self->{shft}++; |
1900 | $self->{shft}++; |
1877 | $::CONN->user_send ("command fire $DIR{$sym}[0]"); |
1901 | $::CONN->user_send ("fire $DIR{$sym}[0]"); |
1878 | } elsif ($mod & KMOD_CTRL) { |
1902 | } elsif ($mod & KMOD_CTRL) { |
1879 | $self->{ctrl}++; |
1903 | $self->{ctrl}++; |
1880 | $::CONN->user_send ("command run $DIR{$sym}[0]"); |
1904 | $::CONN->user_send ("run $DIR{$sym}[0]"); |
1881 | } else { |
1905 | } else { |
1882 | $::CONN->user_send ("command $DIR{$sym}[1]"); |
1906 | $::CONN->user_send ("$DIR{$sym}[1]"); |
1883 | } |
1907 | } |
1884 | } |
1908 | } |
1885 | } |
1909 | } |
1886 | |
1910 | |
1887 | sub key_up { |
1911 | sub key_up { |
… | |
… | |
1889 | |
1913 | |
1890 | my $mod = $ev->key_mod; |
1914 | my $mod = $ev->key_mod; |
1891 | my $sym = $ev->key_sym; |
1915 | my $sym = $ev->key_sym; |
1892 | |
1916 | |
1893 | if (!($mod & KMOD_SHIFT) && delete $self->{shft}) { |
1917 | if (!($mod & KMOD_SHIFT) && delete $self->{shft}) { |
1894 | $::CONN->user_send ("command fire_stop"); |
1918 | $::CONN->user_send ("fire_stop"); |
1895 | } |
1919 | } |
1896 | if (!($mod & KMOD_CTRL ) && delete $self->{ctrl}) { |
1920 | if (!($mod & KMOD_CTRL ) && delete $self->{ctrl}) { |
1897 | $::CONN->user_send ("command run_stop"); |
1921 | $::CONN->user_send ("run_stop"); |
1898 | } |
1922 | } |
1899 | } |
1923 | } |
1900 | |
1924 | |
1901 | ############################################################################# |
1925 | ############################################################################# |
1902 | |
1926 | |
… | |
… | |
2016 | sub add { |
2040 | sub add { |
2017 | my ($self, $widget) = @_; |
2041 | my ($self, $widget) = @_; |
2018 | |
2042 | |
2019 | $self->SUPER::add ($widget); |
2043 | $self->SUPER::add ($widget); |
2020 | |
2044 | |
2021 | $widget->size_allocate ($widget->{x}, $widget->{y}, $widget->size_request); |
2045 | $widget->size_allocate (int $widget->{x}, int $widget->{y}, $widget->size_request); |
2022 | } |
2046 | } |
2023 | |
2047 | |
2024 | sub on_refresh { |
2048 | sub on_refresh { |
2025 | my ($self, $id, $cb) = @_; |
2049 | my ($self, $id, $cb) = @_; |
2026 | |
2050 | |