-
Notifications
You must be signed in to change notification settings - Fork 311
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tkt 1610 change logo without restart #1723
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,18 +45,7 @@ of the License, or (at your option) any later version. | |
import net.sourceforge.ganttproject.chart.GanttChart; | ||
import net.sourceforge.ganttproject.chart.TimelineChart; | ||
import net.sourceforge.ganttproject.document.Document.DocumentException; | ||
import net.sourceforge.ganttproject.gui.GanttLookAndFeelInfo; | ||
import net.sourceforge.ganttproject.gui.GanttLookAndFeels; | ||
import net.sourceforge.ganttproject.gui.GanttStatusBar; | ||
import net.sourceforge.ganttproject.gui.NotificationChannel; | ||
import net.sourceforge.ganttproject.gui.NotificationItem; | ||
import net.sourceforge.ganttproject.gui.NotificationManager; | ||
import net.sourceforge.ganttproject.gui.NotificationManagerImpl; | ||
import net.sourceforge.ganttproject.gui.ResourceTreeUIFacade; | ||
import net.sourceforge.ganttproject.gui.TaskSelectionContext; | ||
import net.sourceforge.ganttproject.gui.TaskTreeUIFacade; | ||
import net.sourceforge.ganttproject.gui.UIFacade; | ||
import net.sourceforge.ganttproject.gui.ViewLogDialog; | ||
import net.sourceforge.ganttproject.gui.*; | ||
import net.sourceforge.ganttproject.gui.options.OptionsPageBuilder; | ||
import net.sourceforge.ganttproject.gui.options.OptionsPageBuilder.I18N; | ||
import net.sourceforge.ganttproject.gui.options.SettingsDialog2; | ||
|
@@ -247,6 +236,23 @@ public void changeValue(ChangeValueEvent event) { | |
myOptions.setTitled(false); | ||
|
||
myLogoOption = new DefaultFileOption("ui.logo"); | ||
myLogoOption.addChangeValueListener(new ChangeValueListener(){ | ||
@Override | ||
public void changeValue(ChangeValueEvent event) { | ||
|
||
if (event.getOldValue()!=null && event.getOldValue().equals(event.getNewValue())){ | ||
Image newLogo =getLogo(); | ||
|
||
|
||
((GanttTree2)myFallbackDelegate.getTaskTree()). | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think that we want to expose that many internal fields and do all these casts to concrete classes and call chains. |
||
getMyProject() | ||
.getGanttChartTabContent(). | ||
replaceImagePanel(newLogo); | ||
} | ||
|
||
} | ||
}); | ||
|
||
myLogoOptions = new GPOptionGroup("ui2", myLogoOption); | ||
myLogoOptions.setTitled(false); | ||
addOptions(myOptions); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any reason why the height must be 50px? There are calculations in the code below which take into account DPI setting. They probably shall not be ignored?