瀏覽代碼

Merge pull request #7679 from CedricGuillemet/fixDisabledCheckbox

disabled color item
David Catuhe 5 年之前
父節點
當前提交
299af75a70
共有 2 個文件被更改,包括 15 次插入1 次删除
  1. 1 1
      gui/src/2D/controls/checkbox.ts
  2. 14 0
      gui/src/2D/controls/control.ts

+ 1 - 1
gui/src/2D/controls/checkbox.ts

@@ -120,7 +120,7 @@ export class Checkbox extends Control {
         }
         }
 
 
         if (this._isChecked) {
         if (this._isChecked) {
-            context.fillStyle = this._isEnabled ? this.color : this._disabledColor;
+            context.fillStyle = this._isEnabled ? this.color : this._disabledColorItem;
             let offsetWidth = actualWidth * this._checkSizeRatio;
             let offsetWidth = actualWidth * this._checkSizeRatio;
             let offseHeight = actualHeight * this._checkSizeRatio;
             let offseHeight = actualHeight * this._checkSizeRatio;
 
 

+ 14 - 0
gui/src/2D/controls/control.ts

@@ -96,6 +96,7 @@ export class Control {
     private _downPointerIds: { [id: number]: boolean } = {};
     private _downPointerIds: { [id: number]: boolean } = {};
     protected _isEnabled = true;
     protected _isEnabled = true;
     protected _disabledColor = "#9a9a9a";
     protected _disabledColor = "#9a9a9a";
+    protected _disabledColorItem = "#6a6a6a";
     /** @hidden */
     /** @hidden */
     protected _rebuildLayout = false;
     protected _rebuildLayout = false;
 
 
@@ -960,6 +961,19 @@ export class Control {
         this._disabledColor = value;
         this._disabledColor = value;
         this._markAsDirty();
         this._markAsDirty();
     }
     }
+    /** Gets or sets front color of control if it's disabled*/
+    public get disabledColorItem(): string {
+        return this._disabledColorItem;
+    }
+
+    public set disabledColorItem(value: string) {
+        if (this._disabledColorItem === value) {
+            return;
+        }
+
+        this._disabledColorItem = value;
+        this._markAsDirty();
+    }
     // Functions
     // Functions
 
 
     /**
     /**