pro_imaj Posted August 10, 2022 Share Posted August 10, 2022 Hi , I'm printing a description with the FieldLabel property of the Uniedit component, can I make this description color according to the Theme when the edit is clicked? Thank you. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted August 10, 2022 Share Posted August 10, 2022 Hello, 1 hour ago, pro_imaj said: description color Do you mean FieldLabel font color? Quote Link to comment Share on other sites More sharing options...
pro_imaj Posted August 11, 2022 Author Share Posted August 11, 2022 5 hours ago, Sherzod said: Hello, Do you mean FieldLabel font color? No, I already know that. What I want to tell is; When the cursor is positioned in Edit, the user understands that the cursor is there with a color. Can this color be brought around the FieldTex part as well? *Color changes according to the theme. In the attached picture, there is a yellow color according to the aria theme, I want this color to be in the fieldtext so that the user can understand which field is filling. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted August 11, 2022 Share Posted August 11, 2022 17 hours ago, pro_imaj said: I will try to check. Quote Link to comment Share on other sites More sharing options...
pro_imaj Posted August 12, 2022 Author Share Posted August 12, 2022 On 8/11/2022 at 10:11 AM, Sherzod said: I will try to check. @Sherzod Is there any progress on this issue? Thanks. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted August 12, 2022 Share Posted August 12, 2022 Hello @pro_imaj Sorry, not yet. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted August 13, 2022 Share Posted August 13, 2022 On 8/11/2022 at 12:11 PM, Sherzod said: On 8/10/2022 at 7:04 PM, pro_imaj said: I will try to check. Hello, Let's try this solution first. As I see it, not all themes are the same in this regard. Some themes don't have border-color, and some have it closer to white. Or need to take the value of another class, please also analyze. And therefore, there may not be a universal solution. Solution: 1. MainForm.Script -> var _themeCSS = Ext.util.CSS.getRule('.x-form-trigger-wrap-default.x-form-trigger-wrap-focus'); if (_themeCSS) { var _themeColor = _themeCSS.style['border-color']; } 2. UniEdit.ClientEvents.UniEvents -> function afterCreate(sender) { sender.on('focus', function(){if (_themeColor) {this.labelTextEl.setStyle('color', _themeColor)}}); sender.on('blur', function(){this.labelTextEl.setStyle('color', '')}); } 1 Quote Link to comment Share on other sites More sharing options...
pro_imaj Posted August 15, 2022 Author Share Posted August 15, 2022 On 8/13/2022 at 9:42 AM, Sherzod said: Hello, Let's try this solution first. As I see it, not all themes are the same in this regard. Some themes don't have border-color, and some have it closer to white. Or need to take the value of another class, please also analyze. And therefore, there may not be a universal solution. Solution: 1. MainForm.Script -> var _themeCSS = Ext.util.CSS.getRule('.x-form-trigger-wrap-default.x-form-trigger-wrap-focus'); if (_themeCSS) { var _themeColor = _themeCSS.style['border-color']; } 2. UniEdit.ClientEvents.UniEvents -> function afterCreate(sender) { sender.on('focus', function(){if (_themeColor) {this.labelTextEl.setStyle('color', _themeColor)}}); sender.on('blur', function(){this.labelTextEl.setStyle('color', '')}); } Hi, @Sherzod The solution you wrote works perfectly, thank you very much. 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.