x11 Posted February 8, 2022 Share Posted February 8, 2022 В некоторых темах иконки fontawesome смотрятся некрасиво, т.к. они имеют серый цвет по умолчанию. А можно ли как-то иконки fontawesome сделать глобально для всего приложения, например, белым или светло-серым цветом? Потому что менять отдельно каждую иконку или иконку на каждой отдельной кнопке, метке, меню - это же неправильно. спасибо Quote Link to comment Share on other sites More sharing options...
zilav Posted February 8, 2022 Share Posted February 8, 2022 нажимаешь F12, инспектором ищешь стиль у иконки, затем смотришь в каком из свойств css задается цвет для этого стиля, переопределяешь. как-то так мне кажется, сам не проверял, задачи такой не стоит Quote Link to comment Share on other sites More sharing options...
picyka Posted February 8, 2022 Share Posted February 8, 2022 3 horas atrás, x11 disse: Em alguns temas, os ícones de fontawesome parecem feios, porque eles têm uma cor cinza por padrão. É possível de alguma forma fazer ícones de fontawesome globalmente para todo o aplicativo, por exemplo, branco ou cinza claro? Porque para alterar separadamente cada ícone ou ícone em cada botão individual, rotular, menu - está errado. obrigado In the last versions there is an option in the UniNativeImageList component, where you can define the color. Quote Link to comment Share on other sites More sharing options...
zilav Posted February 8, 2022 Share Posted February 8, 2022 вообще иконка отрисовывается основным цветом, т.е переопределив его ты поимеешь возможную смену цвета по всему приложению. а так оно вроде в x-panel-body-default задается Quote Link to comment Share on other sites More sharing options...
zilav Posted February 8, 2022 Share Posted February 8, 2022 вот смотри я добавил в css fontawesome color и задал его красным, вуаля, все fontawesome иконки будут красными 1 Quote Link to comment Share on other sites More sharing options...
x11 Posted February 9, 2022 Author Share Posted February 9, 2022 Спасибо, вот так сделал: .fa, .x-fa, .x-fas, .x-fa::before, .x-fas::before, .x-fa4::before, .pictos, .pictos::before { color: red; } А теперь еще вопрос, если позволите? Можно ли как-то в CSS (код выше) добавить еще одно условие, т.е. чтобы этот блок применялся только для определенной темы оформления, например, для "uni_ubuntu"? Если да, то как? спасибопожалусто P.S. ну или как вариант, определять название темы и загружать отдельным файлом еще один CSS. Quote Link to comment Share on other sites More sharing options...
x11 Posted February 9, 2022 Author Share Posted February 9, 2022 16 hours ago, picyka said: In the last versions there is an option in the UniNativeImageList component, where you can define the color. Unfortunately I don't have the latest version, 1555. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted February 9, 2022 Share Posted February 9, 2022 18 minutes ago, x11 said: Можно ли как-то в CSS (код выше) добавить еще одно условие, т.е. чтобы этот блок применялся только для определенной темы оформления, например, для "uni_ubuntu"? Если да, то как? Добрый день, Ну, примерно так: procedure TUniMainModule.UniGUIMainModuleBeforeLogin(Sender: TObject; var Handled: Boolean); begin if Theme = 'xx' then UniServerModule.CustomCSS.Add('.test {}') end; 1 Quote Link to comment Share on other sites More sharing options...
x11 Posted February 9, 2022 Author Share Posted February 9, 2022 ну я почти так и сделал procedure TUniMainModule.LoadScriptCSS; Var sThemeCssFilePath: string; begin // загрузка CSS-стилей и JS-скриптов case UniMainModule.IsMobilePlatform of True: begin UniSession.AddJS('Ext.Loader.loadScript("/files/' + constCssUrlName + constMobileCss + '")'); UniSession.AddJS('Ext.Loader.loadScript("/files/' + constCssUrlName + constMobileHideCss + '")');// скрывать элементы //если есть доп. файл для конкретной темы sThemeCssFilePath := UniServerModule.FilesFolderPath + constCssPath + UniMainModule.TouchTheme + '.css'; if TFile.Exists(sThemeCssFilePath) then UniSession.AddJS('Ext.Loader.loadScript("/files/' + constCssUrlName + UniMainModule.TouchTheme + '.css' + '")'); end; False: begin UniSession.AddJS('Ext.Loader.loadScript("/files/' + constCssUrlName + constDesktopCss + '")'); UniSession.AddJS('Ext.Loader.loadScript("/files/' + constCssUrlName + constDesktopHideCss + '")');// скрывать элементы UniSession.AddJS('Ext.Loader.loadScript("/files/' + cJsURLName + 'HorizontalAccordionUniPanel.js' + '")'); //если есть доп. файл для конкретной темы sThemeCssFilePath := UniServerModule.FilesFolderPath + constCssPath + UniMainModule.Theme + '.css'; if TFile.Exists(sThemeCssFilePath) then UniSession.AddJS('Ext.Loader.loadScript("/files/' + constCssUrlName + UniMainModule.Theme + '.css' + '")'); end; end;//case end; 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.