Imgui: Menu tabs spacing

Created on 10 Feb 2018  路  2Comments  路  Source: ocornut/imgui

I wan't to fill up this spacing for the tabs but if I make them bigger it won't change the spaces
http://prntscr.com/icq5kv

Code:
` constexpr static float get_sidebar_item_width() { return 300.0f; }
constexpr static float get_sidebar_item_height() { return 40.0f; }

template<size_t N>
void render_tabs(char* (&names)[N], int& activetab, float w, float h, bool sameline)
{
    bool values[N] = { false };

    values[activetab] = true;

    for (auto i = 0; i < N; ++i) {
        if (ImGui::ToggleButton(names[i], &values[i], ImVec2{ w, h })) {
            activetab = i;
        }
        if (sameline && i < N - 1)
            ImGui::SameLine();
    }
}

void OnRenderGUI()
{
    Color MenuBackGround = Color(int(Settings::Misc::MenuBackGround[0] * 255.f),
        int(Settings::Misc::MenuBackGround[1] * 255.f),
        int(Settings::Misc::MenuBackGround[2] * 255.f),
        int(Settings::Misc::MenuBackGround[3] * 255.f));

    g_pRender->DrawFillBox(0, 0, iScreenWidth, iScreenHeight, MenuBackGround);

    CLicense lic;
    ImVec2 YouGameComWindowsMain;
    static int tabOrder[] = { 0 , 1 , 2 , 3 , 4 };
    static int tabSelected = 0;

    //static string username = lic.GetUserLogin();

    ImGui::SetNextWindowSize(ImVec2(195, 450));

    if (ImGui::Begin("#Merc", &bIsGuiVisible, ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_ShowBorders))
    {
        ImGui::PushFont(MiddleFont);

        YouGameComWindowsMain = ImGui::GetWindowPos();

        if (Settings::Aimbot::weapon_aim_settings[iWeaponID].aim_FovType > 1)
            Settings::Aimbot::weapon_aim_settings[iWeaponID].aim_FovType = 1;

        if (Settings::Aimbot::weapon_aim_settings[iWeaponID].aim_BestHit > 1)
            Settings::Aimbot::weapon_aim_settings[iWeaponID].aim_BestHit = 1;

        if (Settings::Aimbot::weapon_aim_settings[iWeaponID].aim_Spot > 14)
            Settings::Aimbot::weapon_aim_settings[iWeaponID].aim_Spot = 14;

        static char* tabNames[] = {
            "Aimbot" , "Visuals" , "Skinchanger" ,
            "Misc" , "Colors" };
        render_tabs(tabNames, tabSelected, get_sidebar_item_width(), get_sidebar_item_height(), false);


        ImGui::PopFont();

        ImGui::End();
    }`

Most helpful comment

LUL

All 2 comments

Sorry but #1586

LUL

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ghost picture ghost  路  3Comments

BlackWatersInc picture BlackWatersInc  路  3Comments

spaderthomas picture spaderthomas  路  3Comments

the-lay picture the-lay  路  3Comments

DarkLinux picture DarkLinux  路  3Comments