Merge pull request #2333 from SiboVG/small-fixes

Don't use selected row, but target row for preset selection
This commit is contained in:
Sibo Van Gool 2023-09-17 18:45:26 +02:00 committed by GitHub
commit 204b66f0e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -61,6 +61,7 @@ public class WelcomeDialog extends JDialog {
textPane.setContentType("text/html");
textPane.setMargin(new Insets(10, 10, 10, 10));
textPane.putClientProperty(JTextPane.HONOR_DISPLAY_PROPERTIES, true);
textPane.setBorder(GUIUtil.getUITheme().getBorder());
String sb = "<html>" +
MarkdownUtil.toHtml(releaseNotes) + "<br><br>" +

View File

@ -74,14 +74,13 @@ public class ComponentPresetTable extends JTable {
@Override
public void setValueAt(Object aValue, int rowIndex, int columnIndex) {
// Only support favorite
if ( columnIndex != 0 ) {
if (columnIndex != 0) {
return;
}
int selectedRow = ComponentPresetTable.this.getSelectedRow();
ComponentPreset preset = ComponentPresetTable.this.presets.get(rowIndex);
Application.getComponentPresetDao().setFavorite(preset, presetType, (Boolean) aValue);
ComponentPresetTable.this.updateFavorites();
ComponentPresetTable.this.setRowSelectionInterval(selectedRow, selectedRow);
ComponentPresetTable.this.setRowSelectionInterval(rowIndex, rowIndex);
}
@Override