更改 ExtJS 4 选项卡的高度

发布于 2024-12-02 04:13:33 字数 592 浏览 2 评论 0原文


上下文:我正在编写一个 ExtJS 应用程序来帮助志愿者管理营地数据库。包含紧急信息、饮食要求和舱位分配。我希望它是用户友好的,以便志愿者能够快速掌握它,因此我决定标签需要更大,以引起人们对应用程序主要操作的关注。

问题:我只是不知道如何更改选项卡高度。

到目前为止的工作:

  • 我尝试为我的选项卡面板设置 tabBar 属性,但选项卡没有调整大小,而且样式看起来很奇怪
  • 我浏览了论坛,人们建议修改 CSS,但有没有例子

你能帮忙吗?这就是我想要实现的目标:

http://tinypic.com/r/sltr9g/7

http://postimage.org/image/10x22n8ec/


Context: I'm writing an ExtJS application to help volunteers manage a camp database. Containing emergency information, dietary requirements and cabin allocation. I want it to be user-friendly so that volunteers will pick it up quickly, so I decided the tabs need to be bigger to draw attention to the main actions of the application.

Problem: I just don't know how to change the tab height though.

Work so far:

  • I've tried setting the tabBar property for my tab panel, but the tabs didn't resize and the styling just looked weird
  • I looked through forums and people suggested modifying the CSS, but there were no examples

Can you help? This is what I want to acheive:

http://tinypic.com/r/sltr9g/7

http://postimage.org/image/10x22n8ec/

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

没︽人懂的悲伤 2024-12-09 04:13:33

我想我已经找到解决方案了!

确保您已设置正在使用的 Ext.tab.Panel 的“cls”属性,然后将以下内容粘贴到自定义 CSS 文件中。

.MainPanel .x-tab-bar-strip {
    top: 40px !important; /* Default value is 20, we add 20 = 40 */
}

.MainPanel .x-tab-bar .x-tab-bar-body {
    height: 43px !important; /* Default value is 23, we add 20 = 43 */
    border: 0 !important; /* Overides the border that appears on resizing the grid */
}

.MainPanel .x-tab-bar .x-tab-bar-body .x-box-inner {
    height: 41px !important; /* Default value is 21, we add 20 = 41 */
}

.MainPanel .x-tab-bar .x-tab-bar-body .x-box-inner .x-tab {
    height: 41px !important; /* Default value is 21, we add 20 = 41 */
}

.MainPanel .x-tab-bar .x-tab-bar-body .x-box-inner .x-tab button {
    height: 33px !important; /* Default value 13, we add 20 = 33 */
    line-height: 33px !important; /* Default value 13, we add 20 = 33 */
}

请注意,这会使选项卡变大并使文本居中对齐,但理想情况下图标也居中对齐

I think I've found a solution!

Ensure you have set the 'cls' property of the Ext.tab.Panel you're using, then paste the following into your custom CSS file.

.MainPanel .x-tab-bar-strip {
    top: 40px !important; /* Default value is 20, we add 20 = 40 */
}

.MainPanel .x-tab-bar .x-tab-bar-body {
    height: 43px !important; /* Default value is 23, we add 20 = 43 */
    border: 0 !important; /* Overides the border that appears on resizing the grid */
}

.MainPanel .x-tab-bar .x-tab-bar-body .x-box-inner {
    height: 41px !important; /* Default value is 21, we add 20 = 41 */
}

.MainPanel .x-tab-bar .x-tab-bar-body .x-box-inner .x-tab {
    height: 41px !important; /* Default value is 21, we add 20 = 41 */
}

.MainPanel .x-tab-bar .x-tab-bar-body .x-box-inner .x-tab button {
    height: 33px !important; /* Default value 13, we add 20 = 33 */
    line-height: 33px !important; /* Default value 13, we add 20 = 33 */
}

Note this makes the tabs bigger and middle-aligns the text, but ideally the icon would also be middle-aligned.

久随 2024-12-09 04:13:33

使用 带有 Compass 的新 ExtJS 4 主题,您只需

$tab-height: 40px !default;

appname/resources/ 中 设置: sass/my-ext-theme.scss

您将遇到的唯一问题是 标签栏下方的额外空间错误,在使用自定义主题时总是出现。但这可以很容易地解决,正如那里所解释的,通过设置你的 CSS 之一:

.x-tab-bar
{
    position: absolute;
}

在 ExtJS 包中的 resources/themes/stylesheets/ext4/default/variables/_tabs.scss 文件中,你可以找到其他有用的变量来自定义选项卡大小和颜色。

Using new ExtJS 4 theming with Compass you can just set:

$tab-height: 40px !default;

in appname/resources/sass/my-ext-theme.scss.

The only issue you will encounter is extra space below tab bar bug, which always appears when using custom theme. But this can be solved easily, as explained there, by setting in one of your CSS:

.x-tab-bar
{
    position: absolute;
}

In resources/themes/stylesheets/ext4/default/variables/_tabs.scss file in ExtJS package, you can find other useful variables to customize tab size and color.

梦罢 2024-12-09 04:13:33

如果您使用的是 extjs4,请使用 SASS 和 Compass 在 extjs 样式表中进行任何更改。

您可以在 my-custom-theme.scss 中添加以下变量来更改选项卡的高度:

$tab-height: 40px;

If you are using extjs4 do use the SASS and Compass to make any changes in the extjs stylesheet.

You can just add below variable in my-custom-theme.scss to change the height of the tab:

$tab-height: 40px;
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文