Current Server Time: 22:28 (Central Europe)

#apertus IRC Channel Logs

2020/05/16

Timezone: UTC


00:33
BAndiT1983
changed nick to: BAndiT1983|away
02:54
comradekingu
left the channel
02:59
comradekingu
joined the channel
04:43
Bertl_oO
off to bed now ... have a good one everyone!
04:43
Bertl_oO
changed nick to: Bertl_zZ
06:21
RexOrCine
left the channel
06:30
RexOrCine
joined the channel
07:00
BAndiT1983|away
changed nick to: BAndiT1983
08:19
BAndiT1983
changed nick to: BAndiT1983|away
09:22
BAndiT1983|away
changed nick to: BAndiT1983
09:28
BAndiT1983
hi metal_dent[m], how is it going?
10:43
RexOrCine
left the channel
10:43
RexOrCine
joined the channel
10:44
metal_dent[m]
going good!
10:44
metal_dent[m]
btw Bertl wanted to discuss something about the image conversion yesterday but I guess he forgot
10:46
BAndiT1983
that's good
10:46
BAndiT1983
have checked the logs, as i was not at home yesterday while the meeting was ongoing
10:46
BAndiT1983
he will surely tell you, when back again
11:24
Bertl_zZ
changed nick to: Bertl
11:24
Bertl
morning folks!
11:24
BAndiT1983
hi
11:28
illwieckz
left the channel
12:11
illwieckz
joined the channel
13:26
BAndiT1983
changed nick to: BAndiT1983|away
13:51
aombk2
left the channel
13:58
aombk
joined the channel
14:11
Bertl
off for now ... bbl
14:11
Bertl
changed nick to: Bertl_oO
17:04
panintended
Hi all
17:07
panintended
FYI, the visualizer build is broken - MenuSystem now expects a display in the constructor that it cannot find
17:09
panintended
sent a long message: < https://matrix.org/_matrix/media/r0/download/matrix.org/AScPCzCODqwafmDdqDCCWITf >
17:10
panintended
where IDisplay is an interface that displays implement, including a dummy one that the visualizer can use
17:11
panintended
I can open a task and get on it, let me know
17:38
BAndiT1983|away
changed nick to: BAndiT1983
17:39
BAndiT1983
hi panintended, there shouldn't be a display at all, but we have talked with se6ast1an about it already, as later the firmware won't know the display and only send commands regarding it to bootloader
17:40
BAndiT1983
this display argument has to be replaced by settings object, which should be the central point of holding all the properties and settings
17:46
se6ast1an
about to push, yes
17:46
se6ast1an
I undid the display parameter additions
17:49
se6ast1an
pushed
17:49
BAndiT1983
will check the problems now
17:50
metal_dent[m]
it's working now \o/
17:50
se6ast1an
thanks!
17:56
BAndiT1983
se6ast1an: cause you have a static variable, this is not going to work, as it does not belong to class, just remove static
17:56
BAndiT1983
as you have the DB object in the main, it will be passed to other modules, they can use it and it exists one time
17:57
metal_dent[m]
BAndiT1983: for the ImageButton size I was thinking that the button drawn is basically defined by the rectangle around the image so I think size of the rectangle should be adjusted but the image size should be taken from the header files, what do you think?
17:59
BAndiT1983
ehm, wasn't it the plan that the button size is defined freely and icon is drawn 1:1 to the icon data?
18:00
metal_dent[m]
yes, that's what I'm saying
18:02
metal_dent[m]
here the button is drawn -> https://github.com/MetalDent/AXIOM-Remote/blob/imagebutton-position/Firmware/UI/Widgets/ImageButton.h#L43-L44
18:03
BAndiT1983
sorry, but i still don't see a flexible button and am asking for it since days
18:03
metal_dent[m]
so DrawIcon draws the image and DrawFillRoundRectangle draws the actual button so instead of fixing its size 30x30 we need to define it freely
18:04
se6ast1an
ahh, BAndiT1983 you are a genius!
18:04
se6ast1an
works
18:04
se6ast1an
or at least: "compiles" :)
18:04
metal_dent[m]
> sorry, but i still don't see a flexible button and am asking for it since days
18:04
metal_dent[m]
it's the same old code
18:04
BAndiT1983
se6ast1an: nope, just experience with this darn errors a lot, happens to me quite often if i forget to maintain same object ;)
18:05
BAndiT1983
metal_dent[m]: ok, my understanding was that you've already reworked it, as it takes only a couple of minutes to do
18:08
preetimenghwani[
Hello Bertl_oO
18:08
se6ast1an
metal_dent[m]: can you tell me what the member variables/fields are that IWidget has?
18:10
metal_dent[m]
_x, _y, _width, _height
18:10
se6ast1an
correct
18:10
se6ast1an
these fields are set by constructor and SetDimensions() function right?
18:11
metal_dent[m]
yes
18:11
se6ast1an
if you look at the class IButton, which class does it inherit memberr variables / methods from?
18:12
metal_dent[m]
IWidget
18:12
se6ast1an
very good
18:12
se6ast1an
and what class does your class ImageButton inherit from?
18:12
metal_dent[m]
IButton
18:13
se6ast1an
indeed!
18:13
se6ast1an
so your ImageButton class already has member variables for _x, _y, _width, _height
18:13
se6ast1an
and in your draw() function
18:14
se6ast1an
what are the parameters the painter->DrawFillRoundRectangle() takes?
18:14
se6ast1an
*function
18:14
metal_dent[m]
position, size, radius and bgcolor
18:15
se6ast1an
where position and size are which variables?
18:15
metal_dent[m]
x, y, width, height
18:15
se6ast1an
perfect
18:16
se6ast1an
your code currently uses the following parameters:
18:16
se6ast1an
painter->DrawFillRoundRectangle(_x - 2, _y + 20, 30, 30, _cornerRadius, _currentBackgroundColor);
18:16
se6ast1an
so how would you make that line listen to the buttons inherited x,y,width and height?
18:17
metal_dent[m]
painter->DrawFillRoundRectangle(_x, _y, _width, _height, _cornerRadius, _currentBackgroundColor);
18:17
se6ast1an
excellent!
18:18
se6ast1an
and the next line is a bit more tricky as you want to draw the icon in the center of the area that the round rectangle fills
18:18
se6ast1an
currently its painter->DrawIcon(_image->Data, _x + 1, _y + 23, _image->Width, _image->Height, _currentImageColor);
18:19
se6ast1an
how would you calculate the center x and y coordinates?
18:20
metal_dent[m]
by dividing height and width by 2
18:20
se6ast1an
almost, keep in mind that the icons origin is not in its center
18:21
metal_dent[m]
yes, will have to adjust a bit (like it's done in the PushButton)
18:21
se6ast1an
how will you adjust it a bit
18:22
se6ast1an
keep in mind you have the icons dimensions already at hand ( _image->Width, _image->Height)
18:23
se6ast1an
where is the LCDs origin (0, 0) coordinates?
18:24
metal_dent[m]
top left
18:25
se6ast1an
correct, and the icons origin ?
18:26
metal_dent[m]
_x, _y
18:28
se6ast1an
no I mean which corner of the icon
18:30
metal_dent[m]
top left..?
18:30
se6ast1an
correct!
18:31
se6ast1an
so how far is the distance from the top left corner of the icon to its center?
18:31
se6ast1an
if you have the variables available mentioned above
18:36
se6ast1an
metal_dent[m]: I need to leave very soon, would love to finish this beforehand
18:36
se6ast1an
talk to us :)
18:37
metal_dent[m]
I'm not sure, am trying out in the code
18:37
se6ast1an
dont code anything now
18:37
se6ast1an
stay with us here
18:38
se6ast1an
lets say your icon is a rectangle, you have _image->Data, _image->Width, _image->Height
18:38
se6ast1an
you know the origin is at the top left corner
18:40
se6ast1an
lets say the icon gets drawn at X=100
18:40
se6ast1an
Y=50
18:40
se6ast1an
image or icon width = 50
18:40
se6ast1an
and image/icon height = 60
18:41
se6ast1an
what is the top right corner coordinate of the icon/image?
18:41
metal_dent[m]
rectangle width by 2 - image width by 2 ...?
18:41
se6ast1an
correct!
18:42
se6ast1an
if you mean "divided by 2" ?
18:42
metal_dent[m]
yes
18:42
se6ast1an
great
18:42
se6ast1an
you have a solution for a new PR now
18:44
se6ast1an
off for now, bbl
18:44
metal_dent[m]
actually no, can't make the size of rectangle as _width and _height
18:46
BAndiT1983
why?
18:46
BAndiT1983
am cooking, so you should excuse my periodic absence
18:57
metal_dent[m]
alright there's no problem with that, sorry
18:58
metal_dent[m]
there's some other problem
19:01
metal_dent[m]
SetButton in ButtonBar needs to be changed acc to the button position whether it's in the Top / BottonBar or Left / RightBar
19:10
BAndiT1983
elaborate please
19:18
metal_dent[m]
I mean this -> https://github.com/MetalDent/AXIOM-Remote/blob/imagebutton-position/Firmware/UI/Widgets/ButtonBar.h#L49-L57
19:19
metal_dent[m]
only works if the left, center & right buttons are situated in the top or bottom bars not if the buttons lie in the left or right bars (i.e. top, center & bottom button)
19:23
metal_dent[m]
otherwise it looks like this -> https://pasteboard.co/J8GaUFu.png
19:26
BAndiT1983
it needs adjustments of course, the button bar should recognize automatically its orientation, according to width or height, whatever is bigger
19:27
metal_dent[m]
yes, can I try to add that part?
19:29
BAndiT1983
yes, of course
19:49
metal_dent[m]
done!
19:52
se6ast1an
thanks!
20:16
metal_dent[m]
off to bed now.... good night!
20:16
BAndiT1983
good night
20:48
BAndiT1983
changed nick to: BAndiT1983|away
21:14
megora
joined the channel
21:20
megora
left the channel
21:43
BAndiT1983|away
changed nick to: BAndiT1983
23:03
BAndiT1983
changed nick to: BAndiT1983|away