Skip to content

Commit

Permalink
Merge pull request pyfa-org#123 from Pyfa-fit/enhancement_color_selec…
Browse files Browse the repository at this point in the history
…tion

Enhancement: Color Selection
  • Loading branch information
Ebag333 authored Jun 9, 2017
2 parents 522ef03 + 1fc284a commit eeace2f
Show file tree
Hide file tree
Showing 68 changed files with 819 additions and 443 deletions.
3 changes: 2 additions & 1 deletion gui/PFListPane.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

# noinspection PyPackageRequirements
import wx
from gui.utils.helpers_wxPython import Frame


class PFListPane(wx.ScrolledWindow):
Expand All @@ -30,7 +31,7 @@ def __init__(self, parent):
self._wCount = 0
self.itemsHeight = 1

self.SetBackgroundColour(wx.SystemSettings_GetColour(wx.SYS_COLOUR_WINDOW))
self.SetBackgroundColour(Frame.getBackgroundColor())

self.SetVirtualSize((1, 1))
self.SetScrollRate(0, 1)
Expand Down
9 changes: 6 additions & 3 deletions gui/PFSearchBox.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import wx
import gui.utils.colorUtils as colorUtils
import gui.utils.drawUtils as drawUtils
from gui.utils.helpers_wxPython import Frame

SearchButton, EVT_SEARCH_BTN = wx.lib.newevent.NewEvent()
CancelButton, EVT_CANCEL_BTN = wx.lib.newevent.NewEvent()
Expand All @@ -10,8 +11,8 @@


class PFSearchBox(wx.Window):
def __init__(self, parent, id=wx.ID_ANY, value="", pos=wx.DefaultPosition, size=wx.Size(-1, 24), style=0):
wx.Window.__init__(self, parent, id, pos, size, style=style)
def __init__(self, parent, init_id=wx.ID_ANY, value="", pos=wx.DefaultPosition, size=wx.Size(-1, 24), style=0):
wx.Window.__init__(self, parent, init_id, pos, size, style=style)

self.isSearchButtonVisible = False
self.isCancelButtonVisible = False
Expand Down Expand Up @@ -222,11 +223,13 @@ def UpdateElementsPos(self, dc):
self.editY = (cheight - editHeight) / 2
self.EditBox.SetPosition((self.editX, self.editY))
self.EditBox.SetSize((self.cancelButtonX - self.padding - self.editX, -1))
self.EditBox.SetBackgroundColour(Frame.getBackgroundColorOffset())
self.EditBox.SetForegroundColour(Frame.getForegroundColor())

def OnPaint(self, event):
dc = wx.BufferedPaintDC(self)

bkColor = wx.SystemSettings_GetColour(wx.SYS_COLOUR_WINDOW)
bkColor = Frame.getBackgroundColor()
sepColor = colorUtils.GetSuitableColor(bkColor, 0.2)
rect = self.GetRect()

Expand Down
3 changes: 3 additions & 0 deletions gui/additionsPane.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,15 @@
from gui.bitmapLoader import BitmapLoader

from gui.chromeTabs import PFNotebook
from gui.utils.helpers_wxPython import Frame


class AdditionsPane(TogglePanel):
def __init__(self, parent):

TogglePanel.__init__(self, parent, forceLayout=1)
self.SetBackgroundColour(Frame.getBackgroundColor())
self.SetForegroundColour(Frame.getForegroundColor())

self.SetLabel("Additions")
pane = self.GetContentPane()
Expand Down
2 changes: 1 addition & 1 deletion gui/boosterView.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import gui.marketBrowser as marketBrowser
from gui.builtinViewColumns.state import State
from gui.contextMenu import ContextMenu
from gui.utils.staticHelpers import DragDropHelper
from gui.utils.helpers_wxPython import DragDropHelper
from service.fit import Fit


Expand Down
1 change: 1 addition & 0 deletions gui/builtinPreferenceViews/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

__all__ = [
"pyfaGeneralPreferences",
"pyfaGeneral2Preferences",
"pyfaHTMLExportPreferences",
"pyfaUpdatePreferences",
"pyfaNetworkPreferences",
Expand Down
2 changes: 1 addition & 1 deletion gui/builtinPreferenceViews/dummyView.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
# noinspection PyPackageRequirements
import wx
from gui.preferenceView import PreferenceView
from gui.utils.fonts import Fonts
from gui.utils.helpers_wxPython import Fonts


class DummyView(PreferenceView):
Expand Down
4 changes: 2 additions & 2 deletions gui/builtinPreferenceViews/pyfaContextMenuPreferences.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
from gui.bitmapLoader import BitmapLoader
import gui.mainFrame
from service.settings import ContextMenuSettings
from gui.utils.fonts import Fonts
from gui.utils.helpers_wxPython import Fonts


class PFContextMenuPref(PreferenceView):
title = "Context Menu Panel"
title = "Context Menu"

def populatePrefPanel(self, panel):
self.settings = ContextMenuSettings.getInstance()
Expand Down
2 changes: 1 addition & 1 deletion gui/builtinPreferenceViews/pyfaCrestPreferences.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import gui.mainFrame

from service.settings import CRESTSettings
from gui.utils.fonts import Fonts
from gui.utils.helpers_wxPython import Fonts

# noinspection PyPackageRequirements
from wx.lib.intctrl import IntCtrl
Expand Down
24 changes: 13 additions & 11 deletions gui/builtinPreferenceViews/pyfaDatabasePreferences.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,17 @@
from service.settings import DatabaseSettings
from service.esi import esiItems, esiDogma
import sys
from gui.utils.fonts import Fonts
from gui.utils.helpers_wxPython import Fonts

import logging

logger = logging.getLogger(__name__)


class PFDatabasePref(PreferenceView):
def refreshPanel(self, fit):
pass

title = "Database"

def __init__(self):
Expand All @@ -33,7 +36,7 @@ def populatePrefPanel(self, panel):
self.stTitle.SetFont(Fonts.getFont("font_title_plus_one"))
mainSizer.Add(self.stTitle, 0, wx.ALL, 5)

self.stSubTitle = wx.StaticText(panel, wx.ID_ANY, u"(Cannot be changed while pyfa is running. Set via command line switches.)",
self.stSubTitle = wx.StaticText(panel, wx.ID_ANY, u"Cannot be changed while pyfa is running. Set via command line switches.",
wx.DefaultPosition, wx.DefaultSize, 0)
self.stSubTitle.Wrap(-1)
mainSizer.Add(self.stSubTitle, 0, wx.ALL, 3)
Expand Down Expand Up @@ -85,26 +88,25 @@ def populatePrefPanel(self, panel):
mainSizer.Add(self.m_staticline2, 0, wx.EXPAND | wx.TOP | wx.BOTTOM, 5)

self.stSubTitleTwo = wx.StaticText(panel, wx.ID_ANY, u"DANGER ZONE!\nUsing these options will permanantly delete data out of the database.",
wx.DefaultPosition, wx.DefaultSize, 0)
wx.DefaultPosition, wx.DefaultSize, 0)
self.stSubTitleTwo.Wrap(-1)
mainSizer.Add(self.stSubTitleTwo, 0, wx.ALL, 3)

self.m_staticline3 = wx.StaticLine(panel, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL)
mainSizer.Add(self.m_staticline3, 0, wx.EXPAND | wx.TOP | wx.BOTTOM, 5)

btnSizer = wx.BoxSizer(wx.VERTICAL)
btnSizer.AddSpacer((0, 0), 1, wx.EXPAND, 5)
btnSizer = wx.BoxSizer(wx.HORIZONTAL | wx.ALIGN_LEFT)

self.btnDeleteDamagePatterns = wx.Button(panel, wx.ID_ANY, u"Delete All Damage Pattern Profiles", wx.DefaultPosition, wx.DefaultSize, 0)
btnSizer.Add(self.btnDeleteDamagePatterns, 0, wx.ALL, 5)
btnSizer.Add(self.btnDeleteDamagePatterns, 0, wx.ALL | wx.ALIGN_LEFT, 5)

self.btnDeleteTargetResists = wx.Button(panel, wx.ID_ANY, u"Delete All Target Resist Profiles", wx.DefaultPosition, wx.DefaultSize, 0)
btnSizer.Add(self.btnDeleteTargetResists, 0, wx.ALL, 5)

self.btnPrices = wx.Button(panel, wx.ID_ANY, u"Delete All Prices", wx.DefaultPosition, wx.DefaultSize, 0)
btnSizer.Add(self.btnPrices, 0, wx.ALL, 5)

mainSizer.Add(btnSizer, 0, wx.EXPAND, 5)
mainSizer.Add(btnSizer, 0, wx.EXPAND | wx.ALIGN_LEFT, 5)

self.btnDeleteDamagePatterns.Bind(wx.EVT_BUTTON, self.DeleteDamagePatterns)
self.btnDeleteTargetResists.Bind(wx.EVT_BUTTON, self.DeleteTargetResists)
Expand All @@ -115,7 +117,7 @@ def populatePrefPanel(self, panel):

self.stSubTitleTwo = wx.StaticText(panel, wx.ID_ANY, u"Update Game Data Database\n"
u"Enabling these options will increase the length of time it takes to update.",
wx.DefaultPosition, wx.DefaultSize, 0)
wx.DefaultPosition, wx.DefaultSize, 0)
self.stSubTitleTwo.Wrap(-1)
mainSizer.Add(self.stSubTitleTwo, 0, wx.ALL, 3)

Expand All @@ -126,19 +128,19 @@ def populatePrefPanel(self, panel):
mainSizer.Add(self.btnUpdateDatabase, 0, wx.ALL, 5)

self.cbImportItemsNotInMarketGroups = wx.CheckBox(panel, wx.ID_ANY, u"Import items not in market groups.",
wx.DefaultPosition, wx.DefaultSize, 0)
wx.DefaultPosition, wx.DefaultSize, 0)
mainSizer.Add(self.cbImportItemsNotInMarketGroups, 0, wx.ALL | wx.EXPAND, 5)

self.cbImportItemsNotPublished = wx.CheckBox(panel, wx.ID_ANY, u"Import items that are not published.",
wx.DefaultPosition, wx.DefaultSize, 0)
wx.DefaultPosition, wx.DefaultSize, 0)
mainSizer.Add(self.cbImportItemsNotPublished, 0, wx.ALL | wx.EXPAND, 5)

delayTimer = wx.BoxSizer(wx.HORIZONTAL)

self.stUpdateThreads = wx.StaticText(panel, wx.ID_ANY, u"Threads to use when updating the database:", wx.DefaultPosition, wx.DefaultSize, 0)
self.stUpdateThreads.Wrap(-1)
self.stUpdateThreads.SetToolTip(
wx.ToolTip('More threads may speed up updating the database, but typically little gain is seen above 25.'))
wx.ToolTip('More threads may speed up updating the database, but typically little gain is seen above 25.'))

delayTimer.Add(self.stUpdateThreads, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)

Expand Down
11 changes: 5 additions & 6 deletions gui/builtinPreferenceViews/pyfaEnginePreferences.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from gui.bitmapLoader import BitmapLoader
from gui.preferenceView import PreferenceView
from service.settings import EOSSettings
from gui.utils.fonts import Fonts
from gui.utils.helpers_wxPython import Fonts

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -46,9 +46,9 @@ def populatePrefPanel(self, panel):
wx.DefaultPosition, wx.DefaultSize, 0)
self.cbStrictSkillLevels.SetCursor(helpCursor)
self.cbStrictSkillLevels.SetToolTip(wx.ToolTip(
u'When enabled, skills will check their dependencies\' requirements when their levels change and reset ' +
u'skills that no longer meet the requirement.\neg: Setting Drones from level V to IV will reset the Heavy ' +
u'Drone Operation skill, as that requires Drones V'))
u'When enabled, skills will check their dependencies\' requirements when their levels change and reset ' +
u'skills that no longer meet the requirement.\neg: Setting Drones from level V to IV will reset the Heavy ' +
u'Drone Operation skill, as that requires Drones V'))

mainSizer.Add(self.cbStrictSkillLevels, 0, wx.ALL | wx.EXPAND, 5)

Expand All @@ -58,8 +58,7 @@ def populatePrefPanel(self, panel):
mainSizer.Add(self.cbUniversalAdaptiveArmorHardener, 0, wx.ALL | wx.EXPAND, 5)

self.cbStrictFitting = wx.CheckBox(panel, wx.ID_ANY,
u"Only allow fits that strictly match fitting rules. If this is disabled, fits allowed may not work in EVE." +
u"\n(Only recommended for expert players)",
u"Only allow fits that strictly match fitting rules.",
wx.DefaultPosition, wx.DefaultSize, 0)
mainSizer.Add(self.cbStrictFitting, 0, wx.ALL | wx.EXPAND, 5)

Expand Down
12 changes: 6 additions & 6 deletions gui/builtinPreferenceViews/pyfaGaugePreferences.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@
# -*- coding: utf-8 -*-


import copy

# noinspection PyPackageRequirements
import wx
import copy

from gui.preferenceView import PreferenceView
import gui.utils.drawUtils as drawUtils
from gui.bitmapLoader import BitmapLoader
from gui.preferenceView import PreferenceView
from gui.utils import colorUtils
import gui.utils.drawUtils as drawUtils
from gui.utils.helpers_wxPython import Fonts


###########################################################################
Expand Down Expand Up @@ -38,8 +40,6 @@ def __init__(self, parent, id=wx.ID_ANY, value=0, pos=wx.DefaultPosition, size=w
self.bkColor = wx.Colour(0, 0, 0, 255)
self.SetMinSize((100, -1))

self.font = wx.FontFromPixelSize((0, 13), wx.SWISS, wx.NORMAL, wx.NORMAL, False)

self.timerID = wx.NewId()
self.timer = wx.Timer(self, self.timerID)
self.timerInterval = 20
Expand Down Expand Up @@ -132,7 +132,7 @@ def OnPaint(self, event):

gBmp = drawUtils.DrawGradientBar(r.width, r.height, gMid, color, gcolor)
dc.DrawBitmap(gBmp, 0, 0)
dc.SetFont(self.font)
self.SetFont(Fonts.getFont("font_standard"))

r = copy.copy(rect)
r.left += 1
Expand Down
Loading

0 comments on commit eeace2f

Please sign in to comment.