void UpdateBorder(std::string BorderType) { Assert(BorderType == "focused" || BorderType == "marked", "UpdateBorder()") kwm_border *Border = &FocusedBorder; int WindowID = GetFocusedWindowID(); if(BorderType == "focused" && FocusedBorder.Enabled && PrefixBorder.Enabled && KWMHotkeys.Prefix.Active) { Border = &PrefixBorder; Border->Handle = FocusedBorder.Handle; } else if(BorderType == "marked") { WindowID = KWMScreen.MarkedWindow; Border = &MarkedBorder; } OpenBorder(Border); if(!Border->Enabled) CloseBorder(Border); if(Border->Enabled) { if(WindowID == -1) ClearBorder(Border); else RefreshBorder(Border, WindowID); } }
void LayoutBox::Refresh () { GeneratePosition (); RefreshBorder (); BaseWidget::Refresh (); }
void GAShadowBorder::DeactivateSelf () { // * Get the border redrawn RefreshBorder (); } // GAShadowBorder::DeactivateSelf
void TextField::SetUseBorder(bool use) { if (use && mBorders.empty()) { auto T = std::static_pointer_cast<ImageBox>(UIManager::GetInstance().CreateComponent(ComponentType::ImageBox)); T->SetHwndId(GetHwndId()); mBorders.push_back(T); T->SetRender3D(mRender3D, GetRenderTargetSize()); T->SetManualParent(mSelfPtr.lock()); T->ChangeSizeY(1); T->SetTextureAtlasRegion("EssentialEngineData/textures/ui.xml", "ThinBorder"); auto L = std::static_pointer_cast<ImageBox>(UIManager::GetInstance().CreateComponent(ComponentType::ImageBox)); L->SetHwndId(GetHwndId()); mBorders.push_back(L); L->SetRender3D(mRender3D, GetRenderTargetSize()); L->SetManualParent(mSelfPtr.lock()); L->ChangeSizeX(1); L->SetTextureAtlasRegion("EssentialEngineData/textures/ui.xml", "ThinBorder"); auto R = std::static_pointer_cast<ImageBox>(UIManager::GetInstance().CreateComponent(ComponentType::ImageBox)); R->SetHwndId(GetHwndId()); mBorders.push_back(R); R->SetRender3D(mRender3D, GetRenderTargetSize()); R->SetManualParent(mSelfPtr.lock()); R->SetAlign(ALIGNH::RIGHT, ALIGNV::TOP); R->ChangeSizeX(1); R->SetTextureAtlasRegion("EssentialEngineData/textures/ui.xml", "ThinBorder"); auto B = std::static_pointer_cast<ImageBox>(UIManager::GetInstance().CreateComponent(ComponentType::ImageBox)); B->SetHwndId(GetHwndId()); mBorders.push_back(B); B->SetRender3D(mRender3D, GetRenderTargetSize()); B->SetManualParent(mSelfPtr.lock()); B->SetAlign(ALIGNH::LEFT, ALIGNV::BOTTOM); B->ChangeSizeY(1); B->SetTextureAtlasRegion("EssentialEngineData/textures/ui.xml", "ThinBorder"); auto LT = std::static_pointer_cast<ImageBox>(UIManager::GetInstance().CreateComponent(ComponentType::ImageBox)); LT->SetHwndId(GetHwndId()); mBorders.push_back(LT); LT->SetRender3D(mRender3D, GetRenderTargetSize()); LT->SetManualParent(mSelfPtr.lock()); LT->ChangeSize(Vec2I(1, 1)); LT->SetTextureAtlasRegion("EssentialEngineData/textures/ui.xml", "ThinBorder"); auto RT = std::static_pointer_cast<ImageBox>(UIManager::GetInstance().CreateComponent(ComponentType::ImageBox)); RT->SetHwndId(GetHwndId()); mBorders.push_back(RT); RT->SetRender3D(mRender3D, GetRenderTargetSize()); RT->SetManualParent(mSelfPtr.lock()); RT->ChangeSize(Vec2I(1, 1)); RT->SetAlign(ALIGNH::RIGHT, ALIGNV::TOP); RT->SetTextureAtlasRegion("EssentialEngineData/textures/ui.xml", "ThinBorder"); auto LB = std::static_pointer_cast<ImageBox>(UIManager::GetInstance().CreateComponent(ComponentType::ImageBox)); LB->SetHwndId(GetHwndId()); mBorders.push_back(LB); LB->SetRender3D(mRender3D, GetRenderTargetSize()); LB->SetManualParent(mSelfPtr.lock()); LB->ChangeSize(Vec2I(1, 1)); LB->SetAlign(ALIGNH::LEFT, ALIGNV::BOTTOM); LB->SetTextureAtlasRegion("EssentialEngineData/textures/ui.xml", "ThinBorder"); auto RB = std::static_pointer_cast<ImageBox>(UIManager::GetInstance().CreateComponent(ComponentType::ImageBox)); RB->SetHwndId(GetHwndId()); mBorders.push_back(RB); RB->SetRender3D(mRender3D, GetRenderTargetSize()); RB->SetManualParent(mSelfPtr.lock()); RB->ChangeSize(Vec2I(1, 1)); RB->SetAlign(ALIGNH::RIGHT, ALIGNV::BOTTOM); RB->SetTextureAtlasRegion("EssentialEngineData/textures/ui.xml", "ThinBorder"); RefreshBorder(); RefreshScissorRects(); UIManager::GetInstance().DirtyRenderList(GetHwndId()); } else if (!use && !mBorders.empty()) { mBorders.clear(); UIManager::GetInstance().DirtyRenderList(GetHwndId()); } }