Clean html components

This commit is contained in:
momo5502 2019-01-06 01:10:30 +01:00
parent ba38d467de
commit fa76233e1f
10 changed files with 55 additions and 52 deletions

View File

@ -3,7 +3,6 @@
html_argument::html_argument(VARIANT* val) : value_(val) html_argument::html_argument(VARIANT* val) : value_(val)
{ {
} }
bool html_argument::is_empty() const bool html_argument::is_empty() const

View File

@ -1,6 +1,6 @@
#pragma once #pragma once
#include "window.hpp" #include "../window.hpp"
#include "html/html_frame.hpp" #include "html_frame.hpp"
class html_window final : public window, public html_frame class html_window final : public window, public html_frame
{ {

View File

@ -29,7 +29,8 @@ void launcher::create_main_menu()
this->settings_window_.show(); this->settings_window_.show();
}); });
this->main_window_.set_callback([](window* window, const UINT message, const WPARAM w_param, const LPARAM l_param) -> LRESULT this->main_window_.set_callback(
[](window* window, const UINT message, const WPARAM w_param, const LPARAM l_param) -> LRESULT
{ {
if (message == WM_CLOSE) if (message == WM_CLOSE)
{ {
@ -46,7 +47,8 @@ void launcher::create_main_menu()
void launcher::create_settings_menu() void launcher::create_settings_menu()
{ {
this->settings_window_.set_callback([](window* window, const UINT message, const WPARAM w_param, const LPARAM l_param) -> LRESULT this->settings_window_.set_callback(
[](window* window, const UINT message, const WPARAM w_param, const LPARAM l_param) -> LRESULT
{ {
if (message == WM_CLOSE) if (message == WM_CLOSE)
{ {
@ -57,7 +59,8 @@ void launcher::create_settings_menu()
return DefWindowProcA(*window, message, w_param, l_param); return DefWindowProcA(*window, message, w_param, l_param);
}); });
this->settings_window_.create("Open-IW5 Settings", 400, 200); this->settings_window_.create("Open-IW5 Settings", 400, 200,
WS_OVERLAPPEDWINDOW & ~(WS_THICKFRAME | WS_MAXIMIZEBOX | WS_MINIMIZEBOX));
this->settings_window_.load_html(load_content(MENU_SETTINGS)); this->settings_window_.load_html(load_content(MENU_SETTINGS));
} }

View File

@ -1,5 +1,5 @@
#pragma once #pragma once
#include "html_window.hpp" #include "html/html_window.hpp"
class launcher final class launcher final
{ {

View File

@ -22,7 +22,7 @@ window::window()
RegisterClassEx(&this->wc_); RegisterClassEx(&this->wc_);
} }
void window::create(const std::string& title, const int width, const int height) void window::create(const std::string& title, const int width, const int height, const long flags)
{ {
{ {
std::lock_guard _(mutex_); std::lock_guard _(mutex_);
@ -32,9 +32,8 @@ void window::create(const std::string& title, const int width, const int height)
const auto x = (GetSystemMetrics(SM_CXSCREEN) - width) / 2; const auto x = (GetSystemMetrics(SM_CXSCREEN) - width) / 2;
const auto y = (GetSystemMetrics(SM_CYSCREEN) - height) / 2; const auto y = (GetSystemMetrics(SM_CYSCREEN) - height) / 2;
this->handle_ = CreateWindowExA(NULL, this->wc_.lpszClassName, title.data(), this->handle_ = CreateWindowExA(NULL, this->wc_.lpszClassName, title.data(), flags, x, y, width, height, nullptr,
WS_OVERLAPPEDWINDOW & ~(WS_THICKFRAME | WS_MAXIMIZEBOX), x, y, width, nullptr, this->wc_.hInstance, this);
height, nullptr, nullptr, this->wc_.hInstance, this);
} }
window::~window() window::~window()

View File

@ -8,7 +8,8 @@ public:
window(); window();
virtual ~window(); virtual ~window();
void create(const std::string& title, int width, int height); void create(const std::string& title, int width, int height,
long flags = (WS_OVERLAPPEDWINDOW & ~(WS_THICKFRAME | WS_MAXIMIZEBOX)));
void close(); void close();

View File

@ -39,8 +39,9 @@
.button>span { .button>span {
display: block; display: block;
margin-bottom: 10px; margin-top: -15px;
font-size: 20px; margin-bottom: 15px;
font-size: 25px;
} }
.button>img { .button>img {
@ -73,17 +74,17 @@
#settings { #settings {
position: fixed; position: fixed;
right: 3px; right: 5px;
top: 3px; top: 5px;
width: 25px; width: 25px;
height: 25px; height: 25px;
cursor:pointer; cursor:pointer;
opacity: 0.1; opacity: 0.1;
transition: all 0.08s ease-out; transition: all 0.1s ease-out;
} }
#settings:hover { #settings:hover {
opacity: 0.4; opacity: 0.3;
} }
</style> </style>
</head> </head>