Skip to content

Commit

Permalink
Refactor code
Browse files Browse the repository at this point in the history
  • Loading branch information
SaifAqqad committed Aug 26, 2023
1 parent ad2ebc4 commit 25493ee
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions src/UI/config/UI.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ UI_create(p_onExitCallback){
features:= {"FEATURE_GPU_RENDERING": 0x1
,"FEATURE_BROWSER_EMULATION": 0x2AF8
,"FEATURE_96DPI_PIXEL": 0x1}
UI_enableIeFeatures(features)
UI_setIeFeatures(features, true)
ui_obj:= new NeutronWindow()
ui_obj.load(resources_obj.htmlFile.UI)
UI_enableIeFeatures(features,1)
UI_setIeFeatures(features, false)
UI_loadCss(ui_obj)
OnMessage(WM_SETTINGCHANGE, Func("UI_updateTheme"))
onExitCallback:= p_onExitCallback
Expand All @@ -35,16 +35,16 @@ UI_Show(p_profile, setPos:=1){

UI_HotReload(){
ui_obj.load(resources_obj.htmlFile.UI)
UI_enableIeFeatures(features,1)
UI_setIeFeatures(features, false)
UI_loadCss(ui_obj)
UI_Show(current_profile.ProfileName, 0)
}

UI_enableIeFeatures(f_obj, delete:=0){
UI_setIeFeatures(f_obj, enabled){
static reg_dir:= "SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\"
, executable:= A_IsCompiled? A_ScriptName : util_splitPath(A_AhkPath).fileName
for feature, value in f_obj
if(!delete)
if(enabled)
RegWrite, REG_DWORD, % "HKCU\" reg_dir feature, % executable, % value
else
RegDelete, % "HKCU\" reg_dir feature, % executable
Expand Down
8 changes: 4 additions & 4 deletions src/UI/config/actions/ActionEditor.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
features:= {"FEATURE_GPU_RENDERING": 0x1
,"FEATURE_BROWSER_EMULATION": 0x2AF8
,"FEATURE_96DPI_PIXEL": 0x1}
this.enableIeFeatures(features)
this.setIeFeatures(features, true)
base.__New()
this.enableIeFeatures(features, 1)
this.setIeFeatures(features, false)

OnMessage(WM_SETTINGCHANGE, ObjBindMethod(this, "updateUITheme"))
}
Expand Down Expand Up @@ -67,11 +67,11 @@
}
}

enableIeFeatures(f_obj, delete:=0){
setIeFeatures(f_obj, enabled){
static reg_dir:= "SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\"
, executable:= A_IsCompiled? A_ScriptName : util_splitPath(A_AhkPath).fileName
for feature, value in f_obj
if(!delete)
if(enabled)
RegWrite, REG_DWORD, % "HKCU\" reg_dir feature, % executable, % value
else
RegDelete, % "HKCU\" reg_dir feature, % executable
Expand Down

0 comments on commit 25493ee

Please sign in to comment.