# Path: kano/gtk3/apply_styles.py
# def apply_styling_to_screen(css_file, priority="USER"):
#     css = Gtk.CssProvider()
# 
#     if not os.path.exists(css_file):
#         sys.exit(css_file + ' CSS file missing!')
# 
#     css.load_from_path(css_file)
# 
#     screen = Gdk.Screen.get_default()
#     styleContext = Gtk.StyleContext()
# 
#     if priority == "FALLBACK":
#         gtk_priority = Gtk.STYLE_PROVIDER_PRIORITY_FALLBACK
#     elif priority == "THEME":
#         gtk_priority = Gtk.STYLE_PROVIDER_PRIORITY_THEME
#     elif priority == "SETTINGS":
#         gtk_priority = Gtk.STYLE_PROVIDER_PRIORITY_SETTINGS
#     elif priority == "APPLICATION":
#         gtk_priority = Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION
#     elif priority == "USER":
#         gtk_priority = Gtk.STYLE_PROVIDER_PRIORITY_USER
# 
#     styleContext.add_provider_for_screen(screen, css, gtk_priority)
# 
# Path: kano/paths.py
# DNS_FILE = '/etc/resolvconf/resolv.conf.d/base'
# DNS_INTERFACES_FILE = '/etc/resolvconf/interface-order'
# DNS_INTERFACES_BACKUP_FILE = '/etc/resolvconf/interface-order.backup'
# SUPPLICANT_LOGFILE = '/var/log/kano_wpa.log'
# SUPPLICANT_CONFIG = '/etc/wpa_supplicant/wpa_supplicant.conf'
# INTERNET_UP_FILE = '/var/run/internet_monitor'
# KANO_CONNECT_PIDFILE = '/var/run/kano-connect.pid'


import time
import os
import sys
import types
from gi import require_version
from gi.repository import Gtk, Gdk, GObject, GdkPixbuf
from kano.gtk3.apply_styles import apply_styling_to_screen
from kano.paths import common_images_dir, common_css_dir
# Copyright (C) 2014 - 2018 Kano Computing Ltd.
# License: http://www.gnu.org/licenses/gpl-2.0.txt GNU GPLv2
#
# This is an improved ComboBox (Dropdown) widget.
# It's main advantage over the default is it's ability to set
# the number of items to display when the dropdown is poped up.
#


require_version('Gtk', '3.0')



if __name__ == '__main__' and __package__ is None:
    dir_path = os.path.abspath(
        os.path.join(os.path.dirname(__file__), '../../'))
    if dir_path != '/usr':
        sys.path.insert(1, dir_path)



class KanoComboBox(Gtk.Button):
    # css file
    CSS_PATH = os.path.join(common_css_dir, "kano_combobox.css")

    # default size for the combobox - use set_size_request to change these
    WIDTH = 250
    HEIGHT = 100

    ARROW_DOWN = os.path.join(common_images_dir, "arrow_down.png")

# Path: kano/gtk3/apply_styles.py
# def apply_styling_to_screen(css_file, priority="USER"):
#     css = Gtk.CssProvider()
# 
#     if not os.path.exists(css_file):
#         sys.exit(css_file + ' CSS file missing!')
# 
#     css.load_from_path(css_file)
# 
#     screen = Gdk.Screen.get_default()
#     styleContext = Gtk.StyleContext()
# 
#     if priority == "FALLBACK":
#         gtk_priority = Gtk.STYLE_PROVIDER_PRIORITY_FALLBACK
#     elif priority == "THEME":
#         gtk_priority = Gtk.STYLE_PROVIDER_PRIORITY_THEME
#     elif priority == "SETTINGS":
#         gtk_priority = Gtk.STYLE_PROVIDER_PRIORITY_SETTINGS
#     elif priority == "APPLICATION":
#         gtk_priority = Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION
#     elif priority == "USER":
#         gtk_priority = Gtk.STYLE_PROVIDER_PRIORITY_USER
# 
#     styleContext.add_provider_for_screen(screen, css, gtk_priority)
# 
# Path: kano/paths.py
# DNS_FILE = '/etc/resolvconf/resolv.conf.d/base'
# DNS_INTERFACES_FILE = '/etc/resolvconf/interface-order'
# DNS_INTERFACES_BACKUP_FILE = '/etc/resolvconf/interface-order.backup'
# SUPPLICANT_LOGFILE = '/var/log/kano_wpa.log'
# SUPPLICANT_CONFIG = '/etc/wpa_supplicant/wpa_supplicant.conf'
# INTERNET_UP_FILE = '/var/run/internet_monitor'
# KANO_CONNECT_PIDFILE = '/var/run/kano-connect.pid'


# Path: kano/gtk3/kano_combobox.py
import time
import os
import sys
import types
from gi import require_version
from gi.repository import Gtk, Gdk, GObject, GdkPixbuf
from kano.gtk3.apply_styles import apply_styling_to_screen
from kano.paths import common_images_dir, common_css_dir

# Copyright (C) 2014 - 2018 Kano Computing Ltd.
# License: http://www.gnu.org/licenses/gpl-2.0.txt GNU GPLv2
#
# This is an improved ComboBox (Dropdown) widget.
# It's main advantage over the default is it's ability to set
# the number of items to display when the dropdown is poped up.
#


require_version('Gtk', '3.0')



if __name__ == '__main__' and __package__ is None:
    dir_path = os.path.abspath(
        os.path.join(os.path.dirname(__file__), '../../'))
    if dir_path != '/usr':
        sys.path.insert(1, dir_path)



class KanoComboBox(Gtk.Button):
    # css file
    CSS_PATH = os.path.join(common_css_dir, "kano_combobox.css")

    # default size for the combobox - use set_size_request to change these
    WIDTH = 250
    HEIGHT = 100

    ARROW_DOWN = os.path.join(common_images_dir, "arrow_down.png")

    SCROLL_ARROW_UP = os.path.join(common_images_dir, "scroll_arrow_up.png")