Jump to content

How to increase the height of a "TUniMenuItem"


Luciano França

Recommended Posts

I managed to increase the font size but I need a way to increase the height of the TUniMenuItem due to the large icons that are cut off

How could I do that in this code below ?

Procedure P_SizeMenuUni(FormSelf: TComponent; MenuItem: TUniMenuItem); 
var
 I: Integer;
 fSize: Byte;
 MainMenuName: string;
Begin
 fSize := 17;

 for I := 0 to MenuItem.Count - 1 do Begin
  MainMenuName := MenuItem[I].Name;

  UniSession.AddJS(
   'Ext.onReady(function(){' +
   'var id = ' + FormSelf.Name + '.' + MainMenuName + '.getItemId( )+"-btnInnerEl";' +
   'Ext.util.CSS.createStyleSheet("#"+id+" { font-size: ' + IntToStr(fSize) + 'px; color: black}");' +
   '});'
   );

  UniSession.AddJS(
   'Ext.onReady(function(){' +
   'var id = ' + FormSelf.Name + '.' + MenuItem[I].Name + '.getItemId( )+"-textEl";' +
   'Ext.util.CSS.createStyleSheet("#"+id+" { font-size: ' + IntToStr(fSize) + 'px; color: black}");' +
   '});'
   );

  P_SizeMenuUni(FormSelf, (MenuItem[I]));
 End;

End;

 

 

Size Icon.png

Link to comment
Share on other sites

  • 3 weeks later...
  • 2 weeks later...
  • 2 weeks later...

An alternative would be to change the CSS class.

 

x-menu-item-text-default.x-menu-item-indent {
    margin-left: 48px; /* default 35px */ 
} 
  
.x-menu-item-text-default.x-menu-item-indent-no-separator {
    margin-left: 48px; /* default * 26px; */
}  
  
.x-menu-item-text-default {
    font: normal 13px helvetica, arial, verdana, sans-serif;
    line-height: 56px; /* default 23px */
    padding-top: 1px;
    color: #000;
    cursor: pointer;
} 

.x-menu-item-icon-default {
    width: 36px; /* default 16px */
    height: 36px; /* default 16px */
    top: 10px; /* default  top: 4px; */
    left: 5px;
    line-height: 16px;
    font-size: 16px;
    color: grey;
    background-position: center center;
}

 

Captura de tela 2023-02-24 224535.png

Link to comment
Share on other sites

On 2/24/2023 at 10:47 PM, belo said:

An alternative would be to change the CSS class.

 

x-menu-item-text-default.x-menu-item-indent {
    margin-left: 48px; /* default 35px */ 
} 
  
.x-menu-item-text-default.x-menu-item-indent-no-separator {
    margin-left: 48px; /* default * 26px; */
}  
  
.x-menu-item-text-default {
    font: normal 13px helvetica, arial, verdana, sans-serif;
    line-height: 56px; /* default 23px */
    padding-top: 1px;
    color: #000;
    cursor: pointer;
} 

.x-menu-item-icon-default {
    width: 36px; /* default 16px */
    height: 36px; /* default 16px */
    top: 10px; /* default  top: 4px; */
    left: 5px;
    line-height: 16px;
    font-size: 16px;
    color: grey;
    background-position: center center;
}

 

Captura de tela 2023-02-24 224535.png


Thank you very much for this solution but just one question
    
Where should I put this CSS ?

i put in TUniServerModule.CustomCSS

But the margin was bad even if I changed it to 
 

x-menu-item-text-default.x-menu-item-indent {
    margin-left: 98px; /* default 35px */ 
} 
  
.x-menu-item-text-default.x-menu-item-indent-no-separator {
    margin-left: 98px; /* default * 26px; */
}  


it didn't solve it.

Tested in Google Chrome
Versão 110.0.5481.105 (Versão oficial) 64 bits

Margins_Icons.png

Link to comment
Share on other sites

On 2/27/2023 at 10:15 AM, Luciano França said:


Thank you very much for this solution but just one question
    
Where should I put this CSS ?

i put in TUniServerModule.CustomCSS

But the margin was bad even if I changed it to 
 

x-menu-item-text-default.x-menu-item-indent {
    margin-left: 98px; /* default 35px */ 
} 
  
.x-menu-item-text-default.x-menu-item-indent-no-separator {
    margin-left: 98px; /* default * 26px; */
}  


it didn't solve it.

Tested in Google Chrome
Versão 110.0.5481.105 (Versão oficial) 64 bits

Margins_Icons.png

I believe that I found the problem is in that line that lacked the "." at first

x-menu-item-text-default.x-menu-item-indent {
    margin-left: 98px; /* default 35px */ 
} 

This is the complete solution for anyone who needs it.

.x-btn-default-toolbar-small .x-btn-inner {
  font-size:14px;
}

.x-menu-item-text-default.x-menu-item-indent {
    margin-left: 38px; /* default 35px */ 
} 
  
.x-menu-item-text-default.x-menu-item-indent-no-separator {
    margin-left: 38px; /* default * 26px; */
}  
  
.x-menu-item-text-default {
    font: normal 14px helvetica, arial, verdana, sans-serif;
    line-height: 36px; /* default 23px */
    padding-top: 1px;
    color: #000;
    cursor: pointer;
} 

.x-menu-item-icon-default {
    width: 28px; /* default 16px */
    height: 28px; /* default 16px */
    top: 2px; /* default  top: 4px; */
    left: 5px;
    line-height: 14px;
    font-size: 14px;
    color: grey;
    background-position: center center;
}

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...