Skip to content

Commit 74f0723

Browse files
committed
improved theming
1 parent 2dc206f commit 74f0723

File tree

11 files changed

+52
-33
lines changed

11 files changed

+52
-33
lines changed

matRad/IO/matRad_importPatient.m

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,18 +53,18 @@
5353
ct.numOfCtScen = 1;
5454

5555
maskId = 1;
56-
hGlobalWaitbar = waitbar(0,'Importing Segmentations');
57-
set(findall(hGlobalWaitbar,'type','text'),'Interpreter','none');
58-
59-
56+
matRad_cfg = MatRad_Config.instance();
57+
hGlobalWaitbar = waitbar(0,'Importing Segmentations','Color',matRad_cfg.gui.backgroundColor,'DefaultTextColor',matRad_cfg.gui.textColor);
58+
matRad_applyThemeToWaitbar(hGlobalWaitbar);
6059

6160
for f=1:numel(maskFiles)
6261
maskFile = maskFiles{f};
6362
waitbar(f/numel(maskFiles),hGlobalWaitbar,['Importing Segmentations: ' maskFiles{f}]);
6463
if exist(maskFile,'dir')
6564
contents = dir(maskFile);
66-
hFolderWaitbar = waitbar(0,'Importing Folder');
67-
set(findall(hFolderWaitbar,'type','text'),'Interpreter','none');
65+
hFolderWaitbar = waitbar(0,'Importing Folder','Color',matRad_cfg.gui.backgroundColor,'DefaultTextColor',matRad_cfg.gui.textColor);
66+
matRad_applyThemeToWaitbar(hFolderWaitbar);
67+
6868
for s=1:numel(contents)
6969
waitbar(s/numel(contents),hFolderWaitbar,['Importing Folder: ' contents(s).name]);
7070
if(~contents(s).isdir)

matRad/dicom/matRad_importDicom.m

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@
4242
end
4343

4444
%%
45-
h = waitbar(0,'Please wait...');
45+
h = waitbar(0,'Please wait...','Color',matRad_cfg.gui.backgroundColor,'DefaultTextColor',matRad_cfg.gui.textColor);
46+
matRad_applyThemeToWaitbar(h);
4647
%h.WindowStyle = 'Modal';
4748
steps = 2;
4849

@@ -79,7 +80,8 @@
7980
close(h)
8081

8182
%% creating structure cube
82-
h = waitbar(0,'Please wait...');
83+
h = waitbar(0,'Please wait...','Color',matRad_cfg.gui.backgroundColor,'DefaultTextColor',matRad_cfg.gui.textColor);
84+
matRad_applyThemeToWaitbar(h);
8385
%h.WindowStyle = 'Modal';
8486
steps = numel(structures);
8587

matRad/dicom/matRad_scanDicomImportFolder.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@
5151
if ~isempty(fileList)
5252
%% check for dicom files and differentiate patients, types, and series
5353
numOfFiles = numel(fileList(:,1));
54-
h = waitbar(0,'Please wait...');
54+
h = waitbar(0,'Please wait...','Color',matRad_cfg.gui.backgroundColor,'DefaultTextColor',matRad_cfg.gui.textColor);
55+
matRad_applyThemeToWaitbar(h);
5556
% precision value for double to string conversion
5657
str2numPrc = 10;
5758
%h.WindowStyle = 'Modal';

matRad/doseCalc/+DoseEngines/@matRad_DoseEngineBase/initDoseCalc.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@
4343
% initialize waitbar
4444
% TODO: This should be managed from the user interface instead
4545
if ~matRad_cfg.disableGUI
46-
this.hWaitbar = waitbar(0,msg);
46+
this.hWaitbar = waitbar(0,msg,'Color',matRad_cfg.gui.backgroundColor,'DefaultTextColor',matRad_cfg.gui.textColor);
47+
matRad_applyThemeToWaitbar(this.hWaitbar);
4748
% prevent closure of waitbar and show busy state
4849
set(this.hWaitbar,'pointer','watch');
4950
end

matRad/gui/matRad_Widget.m

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,8 @@ function changedWorkspace(this,varargin)
107107
close(handles.ErrorDlg);
108108
end
109109
end
110-
errordlg(Message);
110+
h = errordlg(Message);
111+
matRad_applyThemeToDlg(h);
111112
matRad_cfg.dispError(Message);
112113
this.handles = handles;
113114
end
@@ -126,10 +127,16 @@ function showWarning(this,Message,ME)
126127
Message = [Message,ME.message];
127128
% Future error hyperlinks {Message,ME.getReport(meType,'hyperlinks','off')};
128129
end
130+
h = warndlg(Message);
131+
matRad_applyThemeToDlg(h);
129132
matRad_cfg.dispWarning(Message);
130-
warndlg(Message);
131133
this.handles = handles;
132134
end
135+
136+
function showMessage(this,message,varargin)
137+
h = msgbox(message,varargin{:});
138+
matRad_applyThemeToDlg(h);
139+
end
133140

134141
%function notifyUpdate(this,workSpaceVariables)
135142
% notify(this,'workspaceChanged',workSpaceVariables);

matRad/gui/widgets/matRad_InfoWidget.m

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -144,20 +144,7 @@ function btnAbout_Callback(this, hObject, event)
144144
msg{end+1} = matRad_info();
145145

146146
handles.aboutBox = msgbox(msg,'About matRad');
147-
148-
if matRad_cfg.isOctave
149-
txtObj = findall(handles.aboutBox,'type','text');
150-
txtObj = txtObj(1);
151-
okBtn = findall(handles.aboutBox,'type','uicontrol','style','pushbutton');
152-
set(findall(handles.aboutBox,'type','uipanel'),'BackgroundColor',matRad_cfg.gui.backgroundColor);
153-
else
154-
txtObj = findall(handles.aboutBox,'tag','MessageBox');
155-
okBtn = findall(handles.aboutBox,'tag','OKButton');
156-
handles.aboutBox.Color = matRad_cfg.gui.backgroundColor;
157-
end
158-
159-
set(txtObj,'Color',matRad_cfg.gui.textColor);
160-
set(okBtn,'BackgroundColor',matRad_cfg.gui.elementColor,'ForegroundColor',matRad_cfg.gui.textColor);
147+
matRad_applyThemeToDlg(handles.aboutBox);
161148

162149
this.handles = handles;
163150
end

matRad/gui/widgets/matRad_WorkflowWidget.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -878,12 +878,12 @@ function CheckOptimizerStatus(this, usedOptimizer,OptCase)
878878
[statusmsg,statusflag] = usedOptimizer.GetStatus();
879879

880880
if statusflag == 0 || statusflag == 1
881-
status = 'none';
881+
statusIcon = 'none';
882882
else
883-
status = 'warn';
883+
statusIcon = 'warn';
884884
end
885885

886-
msgbox(['Optimizer finished with status ' num2str(statusflag) ' (' statusmsg ')'],'Optimizer',status,'modal');
886+
this.showMessage(sprintf('Optimizer finished with status %d (%s)',statusflag,statusmsg),'Optimization finished!',statusIcon,'modal');
887887
end
888888
end
889889
end

matRad/gui/widgets/matRad_exportWidget.m

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,9 @@
306306
methods
307307
%---------------CALLBACK FOR H2 BUTTON EXPORT
308308
function this = btn_export_Callback(this, hObject, event)
309+
310+
matRad_cfg = MatRad_Config.instance();
311+
309312
handles = this.handles;
310313

311314
exportDir = get(handles.edit_dir_export,'String');
@@ -407,7 +410,8 @@
407410

408411
currentCube = 0;
409412

410-
hWaitbar = waitbar(0,'Exporting...','WindowStyle', 'modal');
413+
hWaitbar = waitbar(0,'Exporting...','WindowStyle', 'modal','Color',matRad_cfg.gui.backgroundColor,'DefaultTextColor',matRad_cfg.gui.textColor);
414+
matRad_applyThemeToWaitbar(hWaitbar);
411415
cleanUp = onCleanup(@() close(hWaitbar));
412416

413417
%CT and Mask export

matRad/planAnalysis/matRad_showDVH.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ function matRad_showDVH(dvh,cst,varargin)
142142
%% Legend and limits
143143
fontSizeValue = matRad_cfg.gui.fontSize;
144144
if plotLegend
145-
myLegend = legend(axesHandle,'location','NorthEast','FontSize',matRad_cfg.gui.fontSize,'Interpreter','none');
145+
myLegend = legend(axesHandle,'location','NorthEast','FontSize',matRad_cfg.gui.fontSize,'TextColor',matRad_cfg.gui.textColor,'Interpreter','none');
146146
legend(axesHandle,'boxoff');
147147
legend(axesHandle,'show');
148148
end

matRad/planAnalysis/matRad_showQualityIndicators.m

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,30 @@ function matRad_showQualityIndicators(figHandle,qi)
6363

6464
%since uitable is only available in newer octave versions, we try and catch
6565
try
66+
colorMatrix = repmat(matRad_cfg.gui.elementColor,numel(rnames),1);
67+
ix2 = 2:2:numel(rnames);
68+
if ~isempty(ix2)
69+
shadeColor = rgb2hsv(matRad_cfg.gui.elementColor);
70+
if shadeColor(3) < 0.5
71+
shadeColor(3) = shadeColor(3)*1.5+0.1;
72+
else
73+
shadeColor(3) = shadeColor(3)*0.5-0.1;
74+
end
75+
76+
colorMatrix(ix2,:) = repmat(hsv2rgb(shadeColor),numel(ix2),1);
77+
end
78+
79+
80+
6681
% Create the uitable
6782
table = uitable(hF,'Data',qi,...
6883
'ColumnName',cnames,...
6984
'RowName',rnames,'ColumnWidth',{70},...
7085
'units','normalized',...
7186
'position',pos, ...
7287
'ForegroundColor',matRad_cfg.gui.textColor,...
73-
'BackgroundColor',[matRad_cfg.gui.elementColor;matRad_cfg.gui.backgroundColor]);
88+
'BackgroundColor',colorMatrix,...
89+
'RowStriping','on');
7490
catch ME
7591
matRad_cfg.dispWarning('The uitable function is not implemented in %s v%s.',env,vStr);
7692
end

0 commit comments

Comments
 (0)