Skip to content

Commit

Permalink
Fix bug in windows11 scale 125%
Browse files Browse the repository at this point in the history
  • Loading branch information
Mixdor committed May 16, 2024
1 parent c6986f0 commit 3891d35
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 11 deletions.
2 changes: 2 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import sys

from PyQt6 import QtCore
from PyQt6.QtWidgets import QApplication

from ui.Resources import Resources
Expand All @@ -8,6 +9,7 @@
if __name__ == '__main__':

app = QApplication(sys.argv)
app.setHighDpiScaleFactorRoundingPolicy(QtCore.Qt.HighDpiScaleFactorRoundingPolicy.Round)
app.setStyle('fusion')

resources = Resources()
Expand Down
15 changes: 15 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
from cx_Freeze import setup, Executable

includefiles = [('images', 'lib/images'), ('list_components.txt', 'lib/list_components.txt')]

setup(
name="Circuitikz-Generator",
version="0.6",
description="Tool to design electronic circuits in LaTeX",
executables=[Executable("main.py")],
options={
'build_exe': {
'include_files': includefiles
}
}
)
14 changes: 5 additions & 9 deletions ui/Window.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import os
import subprocess
import webbrowser

from PyQt6.QtCore import Qt, QThread, pyqtSignal, QUrl
Expand Down Expand Up @@ -49,7 +48,7 @@ def __init__(self, base_path):
widget_layout_tools.setFixedWidth(250)
layout.addWidget(widget_layout_tools)

self.name_app = QLabel('CircuiTikZ Generator v0.5')
self.name_app = QLabel('CircuiTikZ Generator v0.6')
self.name_app.setStyleSheet("font-size: 11pt; font-weight: bold")
self.name_app.setContentsMargins(0, 0, 0, 11)
layout_tools.addWidget(self.name_app)
Expand All @@ -62,7 +61,6 @@ def __init__(self, base_path):

list_groups_components = txt_to_components.get_groups()

# Agregar contenido al layout
for i in range(list_groups_components.__len__()):

group_str = list_groups_components[i]
Expand Down Expand Up @@ -228,15 +226,13 @@ def show_generate_latex(self):

def show_web(self):
self.manager_components.unselected()
url = 'https://mixdor.github.io/circuitikz-generator.github.io/'
try:
subprocess.run(['xdg-open', url], check=True)
except subprocess.CalledProcessError as e:
print("Error open to URL:", e)
url = QUrl('https://mixdor.github.io/circuitikz-generator.github.io/')
QDesktopServices.openUrl(url)

def show_kofi(self):
self.manager_components.unselected()
webbrowser.open('https://ko-fi.com/mixdor')
url = QUrl('https://ko-fi.com/mixdor')
QDesktopServices.openUrl(url)

def show_winversion(self, version_available):

Expand Down
2 changes: 1 addition & 1 deletion ui/WindowGenerate.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from PyQt6.QtGui import QClipboard
from PyQt6.QtWidgets import QWidget, QCheckBox, QVBoxLayout, QTextEdit, QPushButton, QDialog, QHBoxLayout, QApplication

from components.Latex import Latex


Expand Down
2 changes: 1 addition & 1 deletion ui/WindowNewVersion.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from PyQt6.QtCore import Qt, QUrl
from PyQt6.QtGui import QDesktopServices, QIcon
from PyQt6.QtGui import QDesktopServices
from PyQt6.QtWidgets import QDialog, QVBoxLayout, QWidget, QLabel, QPushButton, QHBoxLayout


Expand Down

0 comments on commit 3891d35

Please sign in to comment.