#pragma once // FarkStil — CAD Fark pencerelerinin web-birebir görünümü: turkuaz glow pencere // kromu (DialogFiko) + açık-gri CATIA V5 içerik teması (#f5f5f5 gövde, #fff kart, // #1a5276 başlık, #2980b9 vurgu). fark_panel.cpp + fark_karsilastirma.cpp paylaşır. #include #include "fiko/core/temel.hpp" #include "imgui.h" namespace fiko { // Global UI ince ayarları (AyarSistemi gorunum.ui_*): yazı boyutu, boşluk, köşe, // tema, cam saydamlığı. uiStiliUygula() ile kare başında ImGui stiline basılır. struct FikoUiAyar { f32 fontOlcek = 1.0f; // yazı boyutu çarpanı (0.6–1.8) f32 boslukX = 8.0f; // öğe yatay boşluk f32 boslukY = 4.0f; // öğe dikey boşluk f32 kosePolisi = 4.0f; // köşe yuvarlaklığı bool koyuTema = false; // false = açık cam, true = koyu neon f32 camAlfa = 0.58f; // aeroglass zemin saydamlığı (0=opak arka görünmez, 1=cam) }; inline FikoUiAyar& fikoUiAyar() { static FikoUiAyar a; return a; } // Kare başında (NewFrame sonrası, pencerelerden önce): ayarları ImGui stiline bas. inline void uiStiliUygula() { const FikoUiAyar& u = fikoUiAyar(); ImGuiStyle& s = ImGui::GetStyle(); s.ItemSpacing = {u.boslukX, u.boslukY}; s.FramePadding = {std::max(3.0f, u.boslukX * 0.6f), std::max(2.0f, u.boslukY * 0.8f)}; s.ItemInnerSpacing = {std::max(2.0f, u.boslukX * 0.5f), u.boslukY}; s.WindowRounding = u.kosePolisi; s.FrameRounding = std::max(2.0f, u.kosePolisi * 0.7f); s.ChildRounding = std::max(2.0f, u.kosePolisi * 0.7f); s.PopupRounding = std::max(2.0f, u.kosePolisi * 0.7f); s.GrabRounding = std::max(2.0f, u.kosePolisi * 0.7f); ImGui::GetIO().FontGlobalScale = std::clamp(u.fontOlcek, 0.6f, 1.8f); } } // namespace fiko namespace fiko::farkstil { // Web palet sabitleri. inline constexpr ImU32 kBaslikMetin = IM_COL32(0x1a, 0x52, 0x76, 255); inline constexpr ImU32 kVurgu = IM_COL32(0x29, 0x80, 0xb9, 255); inline constexpr ImU32 kKartBg = IM_COL32(0xff, 0xff, 0xff, 255); inline constexpr ImU32 kKartBorder = IM_COL32(0xcc, 0xcc, 0xcc, 255); inline constexpr ImU32 kRozetA = IM_COL32(0x34, 0x98, 0xdb, 255); // Eski (mavi) inline constexpr ImU32 kRozetB = IM_COL32(0x9b, 0x59, 0xb6, 255); // Yeni (mor) inline constexpr ImU32 kYesil = IM_COL32(0x27, 0xae, 0x60, 255); inline constexpr ImU32 kTuruncu = IM_COL32(0xe6, 0x7e, 0x22, 255); inline constexpr ImU32 kKirmizi = IM_COL32(0xe7, 0x4c, 0x3c, 255); inline constexpr ImU32 kSilinenMetin = IM_COL32(0xd1, 0x2b, 0x4a, 255); inline constexpr ImU32 kEklenenMetin = IM_COL32(0x2e, 0x85, 0xd0, 255); inline constexpr ImU32 kViewportBg = IM_COL32(0x2a, 0x2a, 0x3a, 255); // dialog 3D zemini // Açık tema push (Begin'den ÖNCE çağır; pencere kapanınca acikTemaBitir). inline int acikTemaBasla() { const auto c = [](int r, int g, int b, int a = 255) { return ImVec4(r / 255.f, g / 255.f, b / 255.f, a / 255.f); }; int n = 0; const auto P = [&](ImGuiCol k, ImVec4 v) { ImGui::PushStyleColor(k, v); ++n; }; // Aeroglass zemin: yarı saydam koyu-turkuaz (arkadaki 3D sahne görünür) + // aeroGridCiz ızgara deseni. Saydamlık AyarSistemi'nden (camAlfa). İçerik BEYAZ // kartlarda (okunabilirlik korunur); koyu tema seçilirse kart tonları da koyar. const f32 camA = std::clamp(fikoUiAyar().camAlfa, 0.15f, 1.0f); const bool koyu = fikoUiAyar().koyuTema; P(ImGuiCol_WindowBg, koyu ? ImVec4(0.03f, 0.06f, 0.08f, camA) : ImVec4(0.045f, 0.10f, 0.12f, camA)); P(ImGuiCol_ChildBg, c(0xff, 0xff, 0xff)); P(ImGuiCol_PopupBg, c(0xff, 0xff, 0xff)); P(ImGuiCol_Text, c(0x33, 0x33, 0x33)); P(ImGuiCol_TextDisabled, c(0x88, 0x88, 0x88)); P(ImGuiCol_Border, c(0xbb, 0xbb, 0xbb)); P(ImGuiCol_FrameBg, c(0xff, 0xff, 0xff)); P(ImGuiCol_FrameBgHovered, c(0xe8, 0xf4, 0xfc)); P(ImGuiCol_FrameBgActive, c(0xd6, 0xea, 0xf8)); P(ImGuiCol_Button, c(0xf0, 0xf0, 0xf0)); P(ImGuiCol_ButtonHovered, c(0xe0, 0xe0, 0xe0)); P(ImGuiCol_ButtonActive, c(0xd0, 0xd0, 0xd0)); P(ImGuiCol_CheckMark, c(0x29, 0x80, 0xb9)); P(ImGuiCol_SliderGrab, c(0x29, 0x80, 0xb9)); P(ImGuiCol_SliderGrabActive, c(0x1a, 0x52, 0x76)); P(ImGuiCol_Header, c(0xe8, 0xf4, 0xfc)); P(ImGuiCol_HeaderHovered, c(0xd6, 0xea, 0xf8)); P(ImGuiCol_HeaderActive, c(0xc4, 0xe0, 0xf4)); P(ImGuiCol_Separator, c(0xcc, 0xcc, 0xcc)); P(ImGuiCol_TitleBg, c(0x0e, 0x3a, 0x4a)); P(ImGuiCol_TitleBgActive, c(0x10, 0x46, 0x5a)); P(ImGuiCol_Tab, c(0xe0, 0xe0, 0xe0)); P(ImGuiCol_TabHovered, c(0xd6, 0xea, 0xf8)); P(ImGuiCol_ScrollbarBg, c(0xf0, 0xf0, 0xf0)); P(ImGuiCol_ScrollbarGrab, c(0xc0, 0xc0, 0xc0)); return n; } inline void acikTemaBitir(int n) { ImGui::PopStyleColor(n); } // Turkuaz glow krom: pencere rect'inin dışına 3 kat yarı saydam neon çerçeve // (fikoyt DialogFiko görünümü). Begin'den SONRA pencere içinden çağrılır. inline void turkuazGlowCiz() { ImDrawList* dl = ImGui::GetForegroundDrawList(); const ImVec2 p0 = ImGui::GetWindowPos(); const ImVec2 p1{p0.x + ImGui::GetWindowWidth(), p0.y + ImGui::GetWindowHeight()}; const ImU32 nc = IM_COL32(64, 240, 224, 255); dl->AddRect({p0.x - 1, p0.y - 1}, {p1.x + 1, p1.y + 1}, nc, 6.0f, 0, 2.0f); dl->AddRect({p0.x - 3, p0.y - 3}, {p1.x + 3, p1.y + 3}, IM_COL32(64, 240, 224, 90), 8.0f, 0, 3.0f); dl->AddRect({p0.x - 6, p0.y - 6}, {p1.x + 6, p1.y + 6}, IM_COL32(64, 240, 224, 35), 10.0f, 0, 5.0f); } // Aeroglass ızgara deseni: pencere zeminine soluk turkuaz grid (webteki DialogFiko // camsı dokusu). turkuazGlowCiz'den sonra, içerikten ÖNCE çağrılır. inline void aeroGridCiz() { ImDrawList* dl = ImGui::GetWindowDrawList(); const ImVec2 p0 = ImGui::GetWindowPos(); const ImVec2 p1{p0.x + ImGui::GetWindowWidth(), p0.y + ImGui::GetWindowHeight()}; const ImU32 cizgi = IM_COL32(64, 240, 224, 13); constexpr float adim = 14.0f; for (float x = p0.x; x < p1.x; x += adim) dl->AddLine({x, p0.y}, {x, p1.y}, cizgi, 1.0f); for (float y = p0.y; y < p1.y; y += adim) dl->AddLine({p0.x, y}, {p1.x, y}, cizgi, 1.0f); // Üstte hafif parlama (cam hissi). dl->AddRectFilledMultiColor(p0, {p1.x, p0.y + 46.0f}, IM_COL32(64, 240, 224, 26), IM_COL32(64, 240, 224, 26), IM_COL32(0, 0, 0, 0), IM_COL32(0, 0, 0, 0)); } // Beyaz bölüm kartı başlat/bitir (web .section-panel): border'lı child. // DİKKAT: BeginChild false dönse bile EndChild ZORUNLU (ImGui sözleşmesi) — // dönüş yok sayılır, kartBitir HER ZAMAN eşlenir (dengesizlik = bozuk çizim). inline void kartBaslat(const char* kimlik, float yukseklik = 0.0f) { ImGui::PushStyleColor(ImGuiCol_ChildBg, ImVec4(1, 1, 1, 1)); ImGui::PushStyleVar(ImGuiStyleVar_ChildRounding, 3.0f); ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(8, 6)); ImGui::BeginChild(kimlik, {0, yukseklik}, ImGuiChildFlags_Borders | ImGuiChildFlags_AutoResizeY | ImGuiChildFlags_AlwaysUseWindowPadding); } inline void kartBitir() { ImGui::EndChild(); ImGui::PopStyleVar(2); ImGui::PopStyleColor(); ImGui::Dummy({0, 2}); } // Bölüm başlığı (web .section-title): koyu mavi + alt çizgi. inline void bolumBaslik(const char* metin) { ImGui::TextColored(ImGui::ColorConvertU32ToFloat4(kBaslikMetin), "%s", metin); ImGui::Separator(); ImGui::Dummy({0, 1}); } } // namespace fiko::farkstil