Welcome: Replace Label with Image component to show banner and app icon

This commit is contained in:
Hüseyin ASLITÜRK 2020-06-13 12:41:48 +03:00 committed by Andreas Kling
parent d0411f3756
commit d139df706a

View file

@ -24,6 +24,9 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "BackgroundWidget.h"
#include "TextWidget.h"
#include "UnuncheckableButton.h"
#include <AK/Optional.h>
#include <AK/String.h>
#include <AK/StringBuilder.h>
@ -33,6 +36,7 @@
#include <LibGUI/BoxLayout.h>
#include <LibGUI/Button.h>
#include <LibGUI/Desktop.h>
#include <LibGUI/Image.h>
#include <LibGUI/Label.h>
#include <LibGUI/MessageBox.h>
#include <LibGUI/StackWidget.h>
@ -42,10 +46,6 @@
#include <stdio.h>
#include <unistd.h>
#include "BackgroundWidget.h"
#include "TextWidget.h"
#include "UnuncheckableButton.h"
struct ContentPage {
String menu_name;
String title;
@ -214,10 +214,10 @@ int main(int argc, char** argv)
title_box.set_size_policy(GUI::SizePolicy::Fill, GUI::SizePolicy::Fixed);
if (!page.icon.is_empty()) {
auto& icon = title_box.add<GUI::Label>();
icon.set_icon(Gfx::Bitmap::load_from_file(page.icon));
auto& icon = title_box.add<GUI::Image>();
icon.set_preferred_size(16, 16);
icon.set_size_policy(GUI::SizePolicy::Fixed, GUI::SizePolicy::Fixed);
icon.load_from_file(page.icon);
}
auto& content_title = title_box.add<GUI::Label>();