Giter VIP home page Giter VIP logo

Comments (2)

czyt1988 avatar czyt1988 commented on August 13, 2024

//20200831
//tabBarWidth的宽度原来为endX - x;,现需要根据实际进行调整
//为了把tabbar没有tab的部分不占用,这里的宽度需要根据tab的size来进行设置,让tabbar的长度刚刚好,这样能让出
//mainwindow的空间,接受鼠标事件,从而实现拖动等操作,否则tabbar占用整个顶栏,鼠标无法点击到mainwindow
//计算tab所占用的宽度

一句话就是你更新一下最新版就好了,最新版改为非最大最小化时,wps模式会保持

最新修改如下:

    case WpsLiteStyle:
    {
        resizeInWpsLiteStyle();
        return;

        break;
    }

void SARibbonBar::resizeInWpsLiteStyle()中需要修改

int tabBarHight = validTitleBarHeight - 2;
    int tabBarWidth = endX - x;
    //20200831
    //tabBarWidth的宽度原来为endX - x;,现需要根据实际进行调整
    //为了把tabbar没有tab的部分不占用,这里的宽度需要根据tab的size来进行设置,让tabbar的长度刚刚好,这样能让出
    //mainwindow的空间,接受鼠标事件,从而实现拖动等操作,否则tabbar占用整个顶栏,鼠标无法点击到mainwindow
    //计算tab所占用的宽度
    int mintabBarWidth = calcMinTabBarWidth();

    if (mintabBarWidth < tabBarWidth) {
        tabBarWidth = mintabBarWidth;
    }
    y += 2;
    m_d->ribbonTabBar->setGeometry(x
        , y
        , tabBarWidth
        , tabBarHight);

当然和tabbar的addbar和removebar都要重新计算宽度,这里直接会调用resizeInWpsLiteStyle进行刷新。
具体见最新的master提交

from saribbon.

HaojieTian avatar HaojieTian commented on August 13, 2024

from saribbon.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.