mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-04-02 13:37:42 -05:00
sys: Use custom literals for scaled values
This commit is contained in:
@@ -55,7 +55,7 @@ namespace hex::plugin::builtin {
|
||||
|
||||
ImGui::SameLine();
|
||||
|
||||
ImGui::SmallProgressBar(taskProgress, (ImGui::GetCurrentWindow()->MenuBarHeight() - 10 * SharedData::globalScale) / 2.0);
|
||||
ImGui::SmallProgressBar(taskProgress, (ImGui::GetCurrentWindow()->MenuBarHeight() - 10_scaled) / 2.0);
|
||||
ImGui::InfoTooltip(taskName.c_str());
|
||||
}
|
||||
|
||||
@@ -133,7 +133,7 @@ namespace hex::plugin::builtin {
|
||||
if (ImHexApi::Provider::isValid())
|
||||
preview = providers[SharedData::currentProvider]->getName();
|
||||
|
||||
ImGui::SetNextItemWidth(200 * SharedData::globalScale);
|
||||
ImGui::SetNextItemWidth(200_scaled);
|
||||
if (ImGui::BeginCombo("", preview.c_str())) {
|
||||
|
||||
for (int i = 0; i < providers.size(); i++) {
|
||||
|
||||
@@ -48,7 +48,7 @@ namespace hex::plugin::builtin {
|
||||
if (ImHexApi::Provider::isValid() && provider >= 0)
|
||||
preview = providers[provider]->getName();
|
||||
|
||||
ImGui::SetNextItemWidth(200 * SharedData::globalScale);
|
||||
ImGui::SetNextItemWidth(200_scaled);
|
||||
if (ImGui::BeginCombo("", preview.c_str())) {
|
||||
|
||||
for (int i = 0; i < providers.size(); i++) {
|
||||
|
||||
@@ -113,7 +113,7 @@ namespace hex::plugin::builtin {
|
||||
}
|
||||
|
||||
void ViewHelp::drawAboutPopup() {
|
||||
ImGui::SetNextWindowSize(ImVec2(600, 350) * SharedData::globalScale, ImGuiCond_Always);
|
||||
ImGui::SetNextWindowSize(scaled(ImVec2(600, 350)), ImGuiCond_Always);
|
||||
if (ImGui::BeginPopupModal(View::toWindowName("hex.builtin.view.help.about.name").c_str(), &this->m_aboutWindowOpen, ImGuiWindowFlags_NoResize)) {
|
||||
|
||||
if (ImGui::IsKeyDown(ImGui::GetKeyIndex(ImGuiKey_Escape)))
|
||||
|
||||
@@ -177,7 +177,7 @@ namespace hex::plugin::builtin {
|
||||
if (provider->getPageCount() > 1) {
|
||||
ImGui::NewLine();
|
||||
|
||||
auto linePos = ImGui::GetCursorPosY() - 15 * SharedData::globalScale;
|
||||
auto linePos = ImGui::GetCursorPosY() - 15_scaled;
|
||||
|
||||
ImGui::SetCursorPosY(linePos);
|
||||
|
||||
|
||||
@@ -218,7 +218,7 @@ namespace hex::plugin::builtin {
|
||||
}
|
||||
|
||||
void ViewStore::drawContent() {
|
||||
ImGui::SetNextWindowSizeConstraints(ImVec2(600, 400) * SharedData::globalScale, ImVec2(FLT_MAX, FLT_MAX));
|
||||
ImGui::SetNextWindowSizeConstraints(scaled(ImVec2(600, 400)), ImVec2(FLT_MAX, FLT_MAX));
|
||||
if (ImGui::BeginPopupModal(View::toWindowName("hex.builtin.view.store.name").c_str(), &this->getWindowOpenState(), ImGuiWindowFlags_AlwaysAutoResize)) {
|
||||
if (this->m_apiRequest.valid()) {
|
||||
if (this->m_apiRequest.wait_for(0s) != std::future_status::ready)
|
||||
|
||||
Reference in New Issue
Block a user