Skip to content

Commit

Permalink
Fix SiteManager table width
Browse files Browse the repository at this point in the history
Fix LogDialog log font
  • Loading branch information
tresf committed May 14, 2024
1 parent ac5c6c1 commit 1d25cd2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/qz/ui/LogDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public LogDialog(JMenuItem caller, IconCache iconCache) {
}

public void initComponents() {
int defaultFontSize = new JLabel().getFont().getSize();
LinkLabel logDirLabel = new LinkLabel(FileUtilities.USER_DIR + File.separator);
logDirLabel.setLinkLocation(new File(FileUtilities.USER_DIR + File.separator));
setHeader(logDirLabel);
Expand All @@ -58,7 +59,7 @@ public void flush() {
logArea.setEditable(false);
logArea.setLineWrap(true);
logArea.setWrapStyleWord(true);
logArea.setFont(new Font("", Font.PLAIN, 12)); //force fallback font for character support
logArea.setFont(new Font("", Font.PLAIN, defaultFontSize)); //force fallback font for character support

// TODO: Fix button panel resizing issues
clearButton = addPanelButton("Clear", IconCache.Icon.DELETE_ICON, KeyEvent.VK_L);
Expand Down
8 changes: 6 additions & 2 deletions src/qz/ui/component/DisplayTable.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package qz.ui.component;

import qz.utils.SystemUtilities;
import qz.utils.UnixUtilities;

import javax.swing.*;
import javax.swing.table.DefaultTableModel;
import java.awt.*;
Expand Down Expand Up @@ -55,8 +58,9 @@ public void autoSize(int rows, int columns) {
model.addRow(new Object[columns]);
}

int normalWidth = (int)getPreferredScrollableViewportSize().getWidth();
int autoHeight = (int)getPreferredSize().getHeight();
double scaleFactor = SystemUtilities.isLinux() ? UnixUtilities.getScaleFactor() : 1;
int normalWidth = (int)(getPreferredScrollableViewportSize().getWidth() * scaleFactor);
int autoHeight = (int)(getPreferredSize().getHeight() * scaleFactor);
setPreferredScrollableViewportSize(new Dimension(normalWidth, autoHeight));
setFillsViewportHeight(true);
refreshComponents();
Expand Down

0 comments on commit 1d25cd2

Please sign in to comment.