Mercurial > octave
comparison libgui/graphics/PushButtonControl.cc @ 28227:a56ee7986ea4
Use size from 'CData' property of uicontrol to set icon size of buttons (bug #58144).
* PushButtonControl.cc (PushButtonControl::PushButtonControl): Call
setIconSize to set correct size.
* ToggleButtonControl.cc (ToggleButtonControl::ToggleButtonControl): Call
setIconSize to set correct size.
author | Rik <rik@octave.org> |
---|---|
date | Thu, 16 Apr 2020 12:51:31 -0700 |
parents | fbced93c9704 |
children | 486ff0874d68 |
comparison
equal
deleted
inserted
replaced
28226:822dc79a7e97 | 28227:a56ee7986ea4 |
---|---|
69 btn->setAutoFillBackground (true); | 69 btn->setAutoFillBackground (true); |
70 octave_value cdat = up.get_cdata (); | 70 octave_value cdat = up.get_cdata (); |
71 QImage img = Utils::makeImageFromCData (cdat, | 71 QImage img = Utils::makeImageFromCData (cdat, |
72 cdat.columns (), cdat.rows ()); | 72 cdat.columns (), cdat.rows ()); |
73 btn->setIcon (QIcon (QPixmap::fromImage (img))); | 73 btn->setIcon (QIcon (QPixmap::fromImage (img))); |
74 btn->setIconSize (QSize (cdat.columns (), cdat.rows ())); | |
74 } | 75 } |
75 | 76 |
76 PushButtonControl::~PushButtonControl (void) | 77 PushButtonControl::~PushButtonControl (void) |
77 { } | 78 { } |
78 | 79 |