opuntiaOS - an operating system targeting x86 and ARMv7
at master 967 B view raw
1/* 2 * Copyright (C) 2020-2022 The opuntiaOS Project Authors. 3 * + Contributed by Nikita Melekhin <nimelehin@gmail.com> 4 * 5 * Use of this source code is governed by a BSD-style license that can be 6 * found in the LICENSE file. 7 */ 8 9#include "ControlBar.h" 10#include "../../Devices/Screen.h" 11#include "../../Managers/Compositor.h" 12#include <libg/ImageLoaders/PNGLoader.h> 13 14namespace WinServer { 15 16ControlBar* s_WinServer_ControlBar_the = nullptr; 17 18ControlBar::ControlBar() 19 : m_bounds(0, Screen::the().bounds().height() - height(), Screen::the().bounds().width(), height()) 20{ 21 s_WinServer_ControlBar_the = this; 22 LG::PNG::PNGLoader loader; 23 m_menu_icon = loader.load_from_file("/res/system/mobile/control.png"); 24 int x = width() / 2 - m_menu_icon.width() / 2; 25 int y = Screen::the().bounds().height() - height() / 2 - m_menu_icon.height() / 2; 26 m_button_bounds = LG::Rect(x, y, m_menu_icon.width(), m_menu_icon.height()); 27} 28 29} // namespace WinServer