refactor: Use new hyprutils casts (#11377)
This commit is contained in:
parent
aa6a78f0a4
commit
beee22a95e
116 changed files with 715 additions and 696 deletions
|
|
@ -124,10 +124,10 @@ void CHyprGroupBarDecoration::draw(PHLMONITOR pMonitor, float const& a) {
|
|||
static auto PINNERGAP = CConfigValue<Hyprlang::INT>("group:groupbar:gaps_in");
|
||||
static auto PKEEPUPPERGAP = CConfigValue<Hyprlang::INT>("group:groupbar:keep_upper_gap");
|
||||
static auto PTEXTOFFSET = CConfigValue<Hyprlang::INT>("group:groupbar:text_offset");
|
||||
auto* const GROUPCOLACTIVE = (CGradientValueData*)(PGROUPCOLACTIVE.ptr())->getData();
|
||||
auto* const GROUPCOLINACTIVE = (CGradientValueData*)(PGROUPCOLINACTIVE.ptr())->getData();
|
||||
auto* const GROUPCOLACTIVELOCKED = (CGradientValueData*)(PGROUPCOLACTIVELOCKED.ptr())->getData();
|
||||
auto* const GROUPCOLINACTIVELOCKED = (CGradientValueData*)(PGROUPCOLINACTIVELOCKED.ptr())->getData();
|
||||
auto* const GROUPCOLACTIVE = sc<CGradientValueData*>((PGROUPCOLACTIVE.ptr())->getData());
|
||||
auto* const GROUPCOLINACTIVE = sc<CGradientValueData*>((PGROUPCOLINACTIVE.ptr())->getData());
|
||||
auto* const GROUPCOLACTIVELOCKED = sc<CGradientValueData*>((PGROUPCOLACTIVELOCKED.ptr())->getData());
|
||||
auto* const GROUPCOLINACTIVELOCKED = sc<CGradientValueData*>((PGROUPCOLINACTIVELOCKED.ptr())->getData());
|
||||
|
||||
const auto ASSIGNEDBOX = assignedBoxGlobal();
|
||||
|
||||
|
|
@ -295,8 +295,8 @@ CTitleTex::CTitleTex(PHLWINDOW pWindow, const Vector2D& bufferSize, const float
|
|||
static auto PTITLEFONTWEIGHTACTIVE = CConfigValue<Hyprlang::CUSTOMTYPE>("group:groupbar:font_weight_active");
|
||||
static auto PTITLEFONTWEIGHTINACTIVE = CConfigValue<Hyprlang::CUSTOMTYPE>("group:groupbar:font_weight_inactive");
|
||||
|
||||
const auto FONTWEIGHTACTIVE = (CFontWeightConfigValueData*)(PTITLEFONTWEIGHTACTIVE.ptr())->getData();
|
||||
const auto FONTWEIGHTINACTIVE = (CFontWeightConfigValueData*)(PTITLEFONTWEIGHTINACTIVE.ptr())->getData();
|
||||
const auto FONTWEIGHTACTIVE = sc<CFontWeightConfigValueData*>((PTITLEFONTWEIGHTACTIVE.ptr())->getData());
|
||||
const auto FONTWEIGHTINACTIVE = sc<CFontWeightConfigValueData*>((PTITLEFONTWEIGHTINACTIVE.ptr())->getData());
|
||||
|
||||
const CHyprColor COLORACTIVE = CHyprColor(*PTEXTCOLORACTIVE);
|
||||
const CHyprColor COLORINACTIVE = *PTEXTCOLORINACTIVE == -1 ? COLORACTIVE : CHyprColor(*PTEXTCOLORINACTIVE);
|
||||
|
|
@ -333,7 +333,7 @@ static void renderGradientTo(SP<CTexture> tex, CGradientValueData* grad) {
|
|||
pattern = cairo_pattern_create_linear(0, 0, 0, bufferSize.y);
|
||||
|
||||
for (unsigned long i = 0; i < grad->m_colors.size(); i++) {
|
||||
cairo_pattern_add_color_stop_rgba(pattern, 1 - (double)(i + 1) / (grad->m_colors.size() + 1), grad->m_colors[i].r, grad->m_colors[i].g, grad->m_colors[i].b,
|
||||
cairo_pattern_add_color_stop_rgba(pattern, 1 - sc<double>(i + 1) / (grad->m_colors.size() + 1), grad->m_colors[i].r, grad->m_colors[i].g, grad->m_colors[i].b,
|
||||
grad->m_colors[i].a);
|
||||
}
|
||||
|
||||
|
|
@ -368,10 +368,10 @@ void refreshGroupBarGradients() {
|
|||
static auto PGROUPCOLINACTIVE = CConfigValue<Hyprlang::CUSTOMTYPE>("group:groupbar:col.inactive");
|
||||
static auto PGROUPCOLACTIVELOCKED = CConfigValue<Hyprlang::CUSTOMTYPE>("group:groupbar:col.locked_active");
|
||||
static auto PGROUPCOLINACTIVELOCKED = CConfigValue<Hyprlang::CUSTOMTYPE>("group:groupbar:col.locked_inactive");
|
||||
auto* const GROUPCOLACTIVE = (CGradientValueData*)(PGROUPCOLACTIVE.ptr())->getData();
|
||||
auto* const GROUPCOLINACTIVE = (CGradientValueData*)(PGROUPCOLINACTIVE.ptr())->getData();
|
||||
auto* const GROUPCOLACTIVELOCKED = (CGradientValueData*)(PGROUPCOLACTIVELOCKED.ptr())->getData();
|
||||
auto* const GROUPCOLINACTIVELOCKED = (CGradientValueData*)(PGROUPCOLINACTIVELOCKED.ptr())->getData();
|
||||
auto* const GROUPCOLACTIVE = sc<CGradientValueData*>((PGROUPCOLACTIVE.ptr())->getData());
|
||||
auto* const GROUPCOLINACTIVE = sc<CGradientValueData*>((PGROUPCOLINACTIVE.ptr())->getData());
|
||||
auto* const GROUPCOLACTIVELOCKED = sc<CGradientValueData*>((PGROUPCOLACTIVELOCKED.ptr())->getData());
|
||||
auto* const GROUPCOLINACTIVELOCKED = sc<CGradientValueData*>((PGROUPCOLINACTIVELOCKED.ptr())->getData());
|
||||
|
||||
g_pHyprRenderer->makeEGLCurrent();
|
||||
|
||||
|
|
|
|||
|
|
@ -234,26 +234,26 @@ void CDecorationPositioner::onWindowUpdate(PHLWINDOW pWindow) {
|
|||
} else if (LEFT) {
|
||||
pos = wb.pos() - EDGEPOINT - Vector2D{stickyOffsetXL, -stickyOffsetYT};
|
||||
pos.x -= desiredSize;
|
||||
size = {(double)desiredSize, wb.size().y + stickyOffsetYB + stickyOffsetYT};
|
||||
size = {sc<double>(desiredSize), wb.size().y + stickyOffsetYB + stickyOffsetYT};
|
||||
|
||||
if (SOLID)
|
||||
stickyOffsetXL += desiredSize;
|
||||
} else if (RIGHT) {
|
||||
pos = wb.pos() + Vector2D{wb.size().x, 0.0} - EDGEPOINT + Vector2D{stickyOffsetXR, -stickyOffsetYT};
|
||||
size = {(double)desiredSize, wb.size().y + stickyOffsetYB + stickyOffsetYT};
|
||||
size = {sc<double>(desiredSize), wb.size().y + stickyOffsetYB + stickyOffsetYT};
|
||||
|
||||
if (SOLID)
|
||||
stickyOffsetXR += desiredSize;
|
||||
} else if (TOP) {
|
||||
pos = wb.pos() - EDGEPOINT - Vector2D{stickyOffsetXL, stickyOffsetYT};
|
||||
pos.y -= desiredSize;
|
||||
size = {wb.size().x + stickyOffsetXL + stickyOffsetXR, (double)desiredSize};
|
||||
size = {wb.size().x + stickyOffsetXL + stickyOffsetXR, sc<double>(desiredSize)};
|
||||
|
||||
if (SOLID)
|
||||
stickyOffsetYT += desiredSize;
|
||||
} else {
|
||||
pos = wb.pos() + Vector2D{0.0, wb.size().y} - EDGEPOINT - Vector2D{stickyOffsetXL, stickyOffsetYB};
|
||||
size = {wb.size().x + stickyOffsetXL + stickyOffsetXR, (double)desiredSize};
|
||||
size = {wb.size().x + stickyOffsetXL + stickyOffsetXR, sc<double>(desiredSize)};
|
||||
|
||||
if (SOLID)
|
||||
stickyOffsetYB += desiredSize;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue