diff --git a/.gitignore b/.gitignore index b2dccb993..79e536080 100644 --- a/.gitignore +++ b/.gitignore @@ -1,24 +1,27 @@ # Compiled Object files *.slo *.lo *.o # Compiled Dynamic libraries *.so # Compiled Static libraries *.lai *.la *.a # Dolphin stuff .directory # Vim swapfiles .*.swp # KStars Lite Android libraries build_kstarslite/android_libs/* build_kstarslite/android_libs_src/libnova/build/* +#QML compiled files +*.qmlc + CMakeLists.txt.user \ No newline at end of file diff --git a/kstars/CMakeLists.txt b/kstars/CMakeLists.txt index b116927f7..a12ac1918 100644 --- a/kstars/CMakeLists.txt +++ b/kstars/CMakeLists.txt @@ -1,1008 +1,1009 @@ add_subdirectory( data ) add_subdirectory( icons ) add_subdirectory( htmesh ) if (${KF5_VERSION} VERSION_EQUAL 5.18.0 OR ${KF5_VERSION} VERSION_GREATER 5.18.0) SET(HAVE_KF5WIT 1) if(NOT BUILD_KSTARS_LITE) add_subdirectory( tools/whatsinteresting/qml) endif(NOT BUILD_KSTARS_LITE) else() SET(HAVE_KF5WIT 0) endif() Find_package(ZLIB REQUIRED) Find_package(Threads REQUIRED) if(MSVC) add_definitions(-D_USE_MATH_DEFINES=1) add_definitions(-DNOMINMAX) endif() include_directories( ${kstars_SOURCE_DIR}/kstars/skyobjects ${kstars_SOURCE_DIR}/kstars/skycomponents ${kstars_SOURCE_DIR}/kstars/auxiliary ${kstars_SOURCE_DIR}/kstars/time ) if(BUILD_KSTARS_LITE) include_directories( ${kstars_SOURCE_DIR}/kstars/triangle ) else(BUILD_KSTARS_LITE) include_directories( ${kstars_SOURCE_DIR}/kstars/tools ) endif(BUILD_KSTARS_LITE) if(NOT BUILD_KSTARS_LITE) if (CFITSIO_FOUND) set (fits_SRCS fitsviewer/fitshistogram.cpp fitsviewer/fitsdata.cpp fitsviewer/fitsview.cpp fitsviewer/fitsviewer.cpp fitsviewer/fitstab.cpp fitsviewer/fitsdebayer.cpp fitsviewer/bayer.c ) set (fitsui_SRCS fitsviewer/fitsheaderdialog.ui fitsviewer/statform.ui fitsviewer/fitsdebayer.ui indi/streamform.ui fitsviewer/fitshistogramui.ui ) include_directories(${CFITSIO_INCLUDE_DIR}) endif(CFITSIO_FOUND) endif(NOT BUILD_KSTARS_LITE) if (INDI_FOUND) if(BUILD_KSTARS_LITE) set (fits_SRCS fitsviewer/fitsdata.cpp fitsviewer/bayer.c ) include_directories(${CFITSIO_INCLUDE_DIR}) include_directories(${NOVA_INCLUDE_DIR}) set (indi_SRCS indi/clientmanagerlite.cpp indi/inditelescopelite.cpp kstarslite/skyitems/skynodes/crosshairnode.cpp kstarslite/skyitems/telescopesymbolsitem.cpp ) else(BUILD_KSTARS_LITE) set(indiui_SRCS indi/streamform.ui indi/drivermanager.ui indi/opsindi.ui indi/indihostconf.ui indi/telescopewizard.ui ) set(indi_SRCS indi/drivermanager.cpp indi/servermanager.cpp indi/clientmanager.cpp indi/guimanager.cpp indi/driverinfo.cpp indi/deviceinfo.cpp indi/indidevice.cpp indi/indigroup.cpp indi/indiproperty.cpp indi/indielement.cpp indi/indistd.cpp indi/indilistener.cpp indi/inditelescope.cpp indi/indiccd.cpp indi/indifocuser.cpp indi/indifilter.cpp indi/indidome.cpp indi/indiweather.cpp indi/indicap.cpp indi/indilightbox.cpp indi/indidbus.cpp indi/opsindi.cpp indi/telescopewizardprocess.cpp indi/streamwg.cpp indi/videowg.cpp indi/indiwebmanager.cpp ) if (CFITSIO_FOUND) set(ekosui_SRCS ekos/opsekos.ui ekos/ekosmanager.ui ekos/profileeditor.ui # Scheduler ekos/scheduler/scheduler.ui ekos/scheduler/mosaic.ui # Capture ekos/capture/capture.ui ekos/capture/calibrationoptions.ui # Align ekos/align/align.ui # Focus ekos/focus/focus.ui # Mount ekos/mount/mount.ui # Guide ekos/guide/guide.ui ekos/guide/opscalibration.ui ekos/guide/opsguide.ui #TODO remove from GIT #ekos/guide/guider.ui #ekos/guide/rcalibration.ui ) set(ekos_SRCS ekos/ekos.cpp ekos/ekosmanager.cpp ekos/profileeditor.cpp ekos/opsekos.cpp # Auxiliary ekos/auxiliary/QProgressIndicator.cpp ekos/auxiliary/dome.cpp ekos/auxiliary/weather.cpp ekos/auxiliary/dustcap.cpp ekos/auxiliary/darklibrary.cpp # Capture ekos/capture/capture.cpp ekos/capture/sequencejob.cpp # Scheduler ekos/scheduler/schedulerjob.cpp ekos/scheduler/scheduler.cpp ekos/scheduler/mosaic.cpp # Focus ekos/focus/focus.cpp # Mount ekos/mount/mount.cpp # Align ekos/align/align.cpp ekos/align/astrometryparser.cpp ekos/align/offlineastrometryparser.cpp ekos/align/onlineastrometryparser.cpp ekos/align/remoteastrometryparser.cpp # Guide ekos/guide/guide.cpp ekos/guide/guideinterface.cpp ekos/guide/opscalibration.cpp ekos/guide/opsguide.cpp # Internal Guide ekos/guide/internalguide/gmath.cpp ekos/guide/internalguide/internalguider.cpp #ekos/guide/internalguide/guider.cpp ekos/guide/internalguide/matr.cpp #ekos/guide/internalguide/rcalibration.cpp ekos/guide/internalguide/vect.cpp # External Guide ekos/guide/externalguide/phd2.cpp ekos/guide/externalguide/linguider.cpp ) endif(CFITSIO_FOUND) endif(BUILD_KSTARS_LITE) include_directories(${INDI_INCLUDE_DIR}) endif (INDI_FOUND) if(NOT BUILD_KSTARS_LITE) if(WCSLIB_FOUND) include_directories( ${WCSLIB_INCLUDE_DIR} ) endif(WCSLIB_FOUND) if(XPLANET_FOUND) set(xplanet_SRCS xplanet/opsxplanet.cpp ) set(xplanetui_SRCS xplanet/opsxplanet.ui ) endif(XPLANET_FOUND) ########### next target ############### set(libkstarstools_SRCS tools/altvstime.cpp tools/avtplotwidget.cpp tools/calendarwidget.cpp tools/conjunctions.cpp # tools/jmoontool.cpp tools/ksconjunct.cpp tools/eqplotwidget.cpp tools/astrocalc.cpp tools/modcalcangdist.cpp tools/modcalcapcoord.cpp tools/modcalcaltaz.cpp tools/modcalcdaylength.cpp tools/modcalceclipticcoords.cpp tools/modcalcvizequinox.cpp tools/modcalcgalcoord.cpp tools/modcalcgeodcoord.cpp tools/modcalcjd.cpp tools/modcalcplanets.cpp tools/modcalcsidtime.cpp tools/modcalcvlsr.cpp tools/observinglist.cpp tools/obslistpopupmenu.cpp tools/sessionsortfilterproxymodel.cpp tools/obslistwizard.cpp tools/planetviewer.cpp tools/pvplotwidget.cpp tools/scriptargwidgets.cpp tools/scriptbuilder.cpp tools/scriptfunction.cpp tools/skycalendar.cpp tools/wutdialog.cpp tools/flagmanager.cpp tools/horizonmanager.cpp tools/nameresolver.cpp #FIXME Port to KF5 #tools/moonphasetool.cpp tools/starhopper.cpp tools/eyepiecefield.cpp tools/exporteyepieceview.cpp tools/starhopperdialog.cpp tools/adddeepskyobject.cpp ) if(${KF5_VERSION} VERSION_EQUAL 5.18.0 OR ${KF5_VERSION} VERSION_GREATER 5.18.0) set(libkstarstools_SRCS ${libkstarstools_SRCS} tools/whatsinteresting/skyobjlistmodel.cpp tools/whatsinteresting/wiview.cpp tools/whatsinteresting/modelmanager.cpp tools/whatsinteresting/skyobjitem.cpp tools/whatsinteresting/wilpsettings.cpp tools/whatsinteresting/wiequipsettings.cpp tools/whatsinteresting/obsconditions.cpp tools/whatsinteresting/skyobjdescription.cpp ) endif() ki18n_wrap_ui(libkstarstools_SRCS tools/altvstime.ui tools/argchangeviewoption.ui tools/argexportimage.ui tools/argloadcolorscheme.ui tools/arglooktoward.ui tools/argfindobject.ui tools/argprintimage.ui tools/argsetaltaz.ui tools/argsetcolor.ui tools/argsetgeolocation.ui tools/argsetlocaltime.ui tools/argsetradec.ui tools/argsettrack.ui tools/argtimescale.ui tools/argwaitfor.ui tools/argwaitforkey.ui tools/argzoom.ui tools/conjunctions.ui tools/modcalcangdist.ui tools/modcalcapcoord.ui tools/modcalcaltaz.ui tools/modcalcdaylength.ui tools/modcalceclipticcoords.ui tools/modcalcvizequinox.ui tools/modcalcgalcoord.ui tools/modcalcgeod.ui tools/modcalcjd.ui tools/modcalcplanets.ui tools/modcalcsidtime.ui tools/modcalcvlsr.ui tools/observinglist.ui tools/obslistwizard.ui tools/optionstreeview.ui tools/planetviewer.ui tools/scriptbuilder.ui tools/scriptnamedialog.ui tools/skycalendar.ui tools/wutdialog.ui tools/flagmanager.ui tools/starhopperdialog.ui tools/horizonmanager.ui tools/adddeepskyobject.ui ) if (${KF5_VERSION} VERSION_EQUAL 5.18.0 OR ${KF5_VERSION} VERSION_GREATER 5.18.0) ki18n_wrap_ui(libkstarstools_SRCS tools/whatsinteresting/wilpsettings.ui tools/whatsinteresting/wiequipsettings.ui ) endif() set(libkstarswidgets_SRCS widgets/clicklabel.cpp widgets/dmsbox.cpp widgets/draglistbox.cpp widgets/fovwidget.cpp widgets/logedit.cpp widgets/magnitudespinbox.cpp widgets/mapcanvas.cpp widgets/thumbimage.cpp widgets/timespinbox.cpp widgets/timestepbox.cpp widgets/timeunitbox.cpp widgets/infoboxwidget.cpp # widgets/genericcalendarwidget.cpp # widgets/moonphasecalendarwidget.cpp widgets/kshelplabel.cpp widgets/unitspinboxwidget.cpp ) ki18n_wrap_ui(libkstarswidgets_SRCS # widgets/genericcalendarwidget.ui widgets/unitspinboxwidget.ui ) set(kstars_KCFG_SRCS Options.kcfgc) set(kstars_options_SRCS options/opsadvanced.cpp options/opscatalog.cpp options/opscolors.cpp options/opsguides.cpp options/opssolarsystem.cpp options/opssatellites.cpp options/opssupernovae.cpp ) set(kstars_optionsui_SRCS options/opsadvanced.ui options/opscatalog.ui options/opscolors.ui options/opsguides.ui options/opssolarsystem.ui options/opssatellites.ui options/opssupernovae.ui ) set(kstars_dialogs_SRCS dialogs/addcatdialog.cpp dialogs/addlinkdialog.cpp dialogs/detaildialog.cpp dialogs/finddialog.cpp dialogs/focusdialog.cpp dialogs/fovdialog.cpp dialogs/locationdialog.cpp dialogs/timedialog.cpp dialogs/exportimagedialog.cpp ) set(kstars_dialogsui_SRCS dialogs/addcatdialog.ui dialogs/addlinkdialog.ui dialogs/details_database.ui dialogs/details_data.ui dialogs/details_data_comet.ui dialogs/details_links.ui dialogs/details_log.ui dialogs/details_position.ui dialogs/finddialog.ui dialogs/focusdialog.ui dialogs/fovdialog.ui dialogs/locationdialog.ui dialogs/wizwelcome.ui dialogs/wizlocation.ui dialogs/wizdownload.ui dialogs/wizdata.ui dialogs/wizastrometry.ui dialogs/newfov.ui dialogs/exportimagedialog.ui ) set(oal_SRCS oal/log.cpp oal/observer.cpp oal/site.cpp oal/session.cpp oal/scope.cpp oal/eyepiece.cpp oal/filter.cpp oal/observation.cpp oal/lens.cpp oal/equipmentwriter.cpp oal/observeradd.cpp oal/execute.cpp ) set(printing_SRCS printing/detailstable.cpp printing/finderchart.cpp printing/foveditordialog.cpp printing/fovsnapshot.cpp printing/kstarsdocument.cpp printing/legend.cpp printing/loggingform.cpp printing/printingwizard.cpp printing/pwizchartconfig.cpp printing/pwizchartcontents.cpp printing/pwizfovbrowse.cpp printing/pwizfovconfig.cpp printing/pwizfovmanual.cpp printing/pwizfovsh.cpp printing/pwizfovtypeselection.cpp printing/pwizobjectselection.cpp printing/pwizprint.cpp printing/shfovexporter.cpp printing/simplefovexporter.cpp ) set(printingui_SRCS printing/foveditordialog.ui printing/pwizchartconfig.ui printing/pwizchartcontents.ui printing/pwizfovbrowse.ui printing/pwizfovconfig.ui printing/pwizfovmanual.ui printing/pwizfovsh.ui printing/pwizfovtypeselection.ui printing/pwizobjectselection.ui printing/pwizprint.ui printing/pwizwelcome.ui ) set(oal_SRCS oal/log.cpp oal/observer.cpp oal/site.cpp oal/session.cpp oal/scope.cpp oal/eyepiece.cpp oal/filter.cpp oal/observation.cpp oal/lens.cpp oal/equipmentwriter.cpp oal/observeradd.cpp oal/execute.cpp ) set(printing_SRCS printing/detailstable.cpp printing/finderchart.cpp printing/foveditordialog.cpp printing/fovsnapshot.cpp printing/kstarsdocument.cpp printing/legend.cpp printing/loggingform.cpp printing/printingwizard.cpp printing/pwizchartconfig.cpp printing/pwizchartcontents.cpp printing/pwizfovbrowse.cpp printing/pwizfovconfig.cpp printing/pwizfovmanual.cpp printing/pwizfovsh.cpp printing/pwizfovtypeselection.cpp printing/pwizobjectselection.cpp printing/pwizprint.cpp printing/shfovexporter.cpp printing/simplefovexporter.cpp ) set(printingui_SRCS printing/foveditordialog.ui printing/pwizchartconfig.ui printing/pwizchartcontents.ui printing/pwizfovbrowse.ui printing/pwizfovconfig.ui printing/pwizfovmanual.ui printing/pwizfovsh.ui printing/pwizfovtypeselection.ui printing/pwizobjectselection.ui printing/pwizprint.ui printing/pwizwelcome.ui ) endif(NOT BUILD_KSTARS_LITE) set( kstars_KCFG_SRCS Options.kcfgc ) set(libkstarscomponents_SRCS skycomponents/skylabeler.cpp skycomponents/highpmstarlist.cpp skycomponents/skymapcomposite.cpp skycomponents/skymesh.cpp skycomponents/linelistindex.cpp skycomponents/linelistlabel.cpp skycomponents/noprecessindex.cpp skycomponents/listcomponent.cpp skycomponents/pointlistcomponent.cpp skycomponents/solarsystemsinglecomponent.cpp skycomponents/solarsystemlistcomponent.cpp skycomponents/asteroidscomponent.cpp skycomponents/cometscomponent.cpp skycomponents/planetmoonscomponent.cpp skycomponents/solarsystemcomposite.cpp skycomponents/satellitescomponent.cpp skycomponents/starcomponent.cpp skycomponents/deepstarcomponent.cpp skycomponents/deepskycomponent.cpp skycomponents/catalogcomponent.cpp skycomponents/syncedcatalogcomponent.cpp skycomponents/constellationartcomponent.cpp skycomponents/constellationboundarylines.cpp skycomponents/constellationlines.cpp skycomponents/constellationnamescomponent.cpp skycomponents/supernovaecomponent.cpp skycomponents/coordinategrid.cpp skycomponents/equatorialcoordinategrid.cpp skycomponents/horizontalcoordinategrid.cpp skycomponents/ecliptic.cpp skycomponents/equator.cpp skycomponents/artificialhorizoncomponent.cpp skycomponents/horizoncomponent.cpp skycomponents/milkyway.cpp skycomponents/skycomponent.cpp skycomponents/skycomposite.cpp skycomponents/starblock.cpp skycomponents/starblocklist.cpp skycomponents/starblockfactory.cpp skycomponents/culturelist.cpp skycomponents/flagcomponent.cpp skycomponents/targetlistcomponent.cpp ) if(NOT BUILD_KSTARS_LITE) LIST(APPEND libkstarscomponents_SRCS #skycomponents/notifyupdatesui.cpp ) else(NOT BUILD_KSTARS_LITE) set(libkstarstools_SRCS tools/nameresolver.cpp ) endif(NOT BUILD_KSTARS_LITE) set(kstars_skyobjects_SRCS skyobjects/constellationsart.cpp skyobjects/deepskyobject.cpp # skyobjects/jupitermoons.cpp # skyobjects/planetmoons.cpp skyobjects/ksasteroid.cpp skyobjects/kscomet.cpp skyobjects/ksmoon.cpp skyobjects/ksplanetbase.cpp skyobjects/ksplanet.cpp #skyobjects/kspluto.cpp skyobjects/kssun.cpp skyobjects/skyline.cpp skyobjects/skyobject.cpp skyobjects/skypoint.cpp skyobjects/starobject.cpp skyobjects/trailobject.cpp skyobjects/satellite.cpp skyobjects/satellitegroup.cpp skyobjects/supernova.cpp ) set(kstars_projection_SRCS projections/projector.cpp projections/lambertprojector.cpp projections/gnomonicprojector.cpp projections/stereographicprojector.cpp projections/orthographicprojector.cpp projections/azimuthalequidistantprojector.cpp projections/equirectangularprojector.cpp ) set(kstars_extra_SRCS auxiliary/colorscheme.cpp auxiliary/dms.cpp auxiliary/cachingdms.cpp auxiliary/geolocation.cpp auxiliary/ksfilereader.cpp auxiliary/ksuserdb.cpp auxiliary/binfilehelper.cpp auxiliary/ksutils.cpp auxiliary/ksdssimage.cpp auxiliary/ksdssdownloader.cpp auxiliary/profileinfo.cpp auxiliary/filedownloader.cpp auxiliary/kspaths.cpp auxiliary/QRoundProgressBar.cpp auxiliary/skyobjectlistmodel.cpp auxiliary/ksnotification.cpp time/simclock.cpp time/kstarsdatetime.cpp time/timezonerule.cpp ksnumbers.cpp kstarsdata.cpp texturemanager.cpp #to minimize number of indef KSTARS_LITE skypainter.cpp ) if(NOT BUILD_KSTARS_LITE) LIST(APPEND kstars_extra_SRCS auxiliary/imageviewer.cpp auxiliary/fov.cpp auxiliary/thumbnailpicker.cpp auxiliary/thumbnaileditor.cpp auxiliary/imageexporter.cpp auxiliary/kswizard.cpp auxiliary/qcustomplot.cpp kstarsdbus.cpp kspopupmenu.cpp ksalmanac.cpp kstarsactions.cpp kstarsinit.cpp kstars.cpp kstarssplash.cpp skymap.cpp skymapdrawabstract.cpp skymapqdraw.cpp skymapevents.cpp skyqpainter.cpp ) endif(NOT BUILD_KSTARS_LITE) if(BUILD_KSTARS_LITE) #Temporary solution to allow use of qml files from source dir DELETE add_definitions( -DSOURCE_DIR=\"${kstars_SOURCE_DIR}\" ) add_definitions(-DQML_IMPORT="${CMAKE_CURRENT_SOURCE_DIR}") set(kstarslite_SRCS kstarslite.cpp kstarsliteinit.cpp skymaplite.cpp skymapliteevents.cpp #Wrappers kstarslite/skypointlite.cpp kstarslite/skyobjectlite.cpp #ImageProvider kstarslite/imageprovider.cpp #Dialogs kstarslite/dialogs/detaildialoglite.cpp kstarslite/dialogs/finddialoglite.cpp kstarslite/dialogs/locationdialoglite.cpp #RootNode kstarslite/skyitems/rootnode.cpp kstarslite/skyitems/skyopacitynode.cpp kstarslite/skyitems/typedeflite.h #SkyItems kstarslite/skyitems/skyitem.cpp kstarslite/skyitems/planetsitem.cpp kstarslite/skyitems/asteroidsitem.cpp kstarslite/skyitems/cometsitem.cpp kstarslite/skyitems/horizonitem.cpp kstarslite/skyitems/labelsitem.cpp kstarslite/skyitems/constellationnamesitem.cpp kstarslite/skyitems/staritem.cpp kstarslite/skyitems/deepstaritem.cpp kstarslite/skyitems/deepskyitem.cpp kstarslite/skyitems/constellationartitem.cpp kstarslite/skyitems/satellitesitem.cpp kstarslite/skyitems/supernovaeitem.cpp kstarslite/skyitems/fovitem.cpp kstarslite/skyitems/syncedcatalogitem.cpp #Line kstarslite/skyitems/lines/linesitem.cpp kstarslite/skyitems/lines/equatoritem.cpp kstarslite/skyitems/lines/eclipticitem.cpp kstarslite/skyitems/lines/milkywayitem.cpp #SkyNodes kstarslite/skyitems/skynodes/planetnode.cpp kstarslite/skyitems/skynodes/skynode.cpp kstarslite/skyitems/skynodes/pointsourcenode.cpp kstarslite/skyitems/skynodes/planetmoonsnode.cpp kstarslite/skyitems/skynodes/horizonnode.cpp kstarslite/skyitems/skynodes/labelnode.cpp kstarslite/skyitems/skynodes/guidelabelnode.cpp kstarslite/skyitems/skynodes/deepskynode.cpp kstarslite/skyitems/skynodes/dsosymbolnode.cpp kstarslite/skyitems/skynodes/skypolygonnode.cpp kstarslite/skyitems/skynodes/constellationartnode.cpp kstarslite/skyitems/skynodes/satellitenode.cpp kstarslite/skyitems/skynodes/supernovanode.cpp kstarslite/skyitems/skynodes/trixelnode.cpp kstarslite/skyitems/skynodes/fovsymbolnode.cpp #Nodes kstarslite/skyitems/skynodes/nodes/pointnode.cpp kstarslite/skyitems/skynodes/nodes/polynode.cpp kstarslite/skyitems/skynodes/nodes/linenode.cpp kstarslite/skyitems/skynodes/nodes/ellipsenode.cpp kstarslite/skyitems/skynodes/nodes/rectnode.cpp #Material #kstarslite/skyitems/skynodes/material/dashedshader.cpp #libtess libtess/dict.c libtess/geom.c libtess/gluos.h libtess/memalloc.c libtess/mesh.c libtess/normal.c libtess/priorityq-sort.h libtess/priorityq.c libtess/render.c libtess/sweep.c libtess/tess.c libtess/tessmono.c libtess/priorityq-heap.c libtess/dict-list.h libtess/glu.h libtess/tessellate.c ) #Qml files will be probably moved to user's data dir, but for use #with QtCreator it is more convenient to have them here set(kstarsliteqml_SRCS kstarslite/qml/main.qml kstarslite/qml/constants/Constants.qml kstarslite/qml/modules/SkyMapLiteWrapper.qml kstarslite/qml/modules/BottomMenu.qml kstarslite/qml/modules/KSPage.qml kstarslite/qml/modules/KSListView.qml kstarslite/qml/modules/KSLabel.qml kstarslite/qml/modules/KSText.qml kstarslite/qml/modules/KSTabButton.qml kstarslite/qml/modules/KSTab.qml + kstarslite/qml/modules/KSTabBarArrow.qml kstarslite/qml/modules/KSTextField.qml kstarslite/qml/modules/KSButton.qml kstarslite/qml/modules/TopMenu.qml kstarslite/qml/modules/helpers/TopMenuButton.qml kstarslite/qml/modules/helpers/BottomMenuButton.qml kstarslite/qml/modules/Splash.qml kstarslite/qml/modules/helpers/TimeSpinBox.qml kstarslite/qml/modules/TimePage.qml #Popups kstarslite/qml/modules/popups/ProjectionsPopup.qml kstarslite/qml/modules/popups/FOVPopup.qml kstarslite/qml/modules/popups/ColorSchemePopup.qml #Menus kstarslite/qml/modules/menus/ContextMenu.qml #Helpers kstarslite/qml/modules/helpers/PassiveNotification.qml kstarslite/qml/modules/helpers/KSMenuItem.qml kstarslite/qml/modules/helpers/TelescopeControl.qml #Dialogs kstarslite/qml/dialogs/FindDialog.qml kstarslite/qml/dialogs/LocationDialog.qml kstarslite/qml/dialogs/DetailsDialog.qml kstarslite/qml/dialogs/helpers/DetailsItem.qml kstarslite/qml/dialogs/helpers/DetailsAddLink.qml kstarslite/qml/dialogs/helpers/LocationEdit.qml kstarslite/qml/dialogs/helpers/LocationLoading.qml kstarslite/qml/dialogs/menus/DetailsLinkMenu.qml kstarslite/qml/dialogs/menus/LocationsGeoMenu.qml #INDI kstarslite/qml/indi/INDIControlPanel.qml kstarslite/qml/indi/DevicePanel.qml kstarslite/qml/indi/ImagePreview.qml kstarslite/qml/indi/modules/MotionControl.qml kstarslite/qml/indi/modules/Led.qml kstarslite/qml/indi/modules/KSLed.qml kstarslite/qml/indi/modules/Property.qml kstarslite/qml/indi/modules/KSComboBox.qml kstarslite/qml/indi/modules/KSButtonSwitch.qml kstarslite/qml/indi/modules/KSCheckBox.qml kstarslite/qml/indi/modules/KSINDIText.qml kstarslite/qml/indi/modules/KSINDITextField.qml kstarslite/qml/indi/modules/KSButtonsSwitchRow.qml #Tutorial kstarslite/qml/modules/tutorial/TutorialPopup.qml kstarslite/qml/modules/tutorial/TutorialExitPopup.qml kstarslite/qml/modules/tutorial/TutorialStep1.qml kstarslite/qml/modules/tutorial/TutorialStep2.qml kstarslite/qml/modules/tutorial/TutorialStep3.qml kstarslite/qml/modules/tutorial/TutorialStep4.qml kstarslite/qml/modules/tutorial/TutorialStep5.qml kstarslite/qml/modules/tutorial/TutorialPane.qml ) add_subdirectory(kstarslite/qml) ADD_CUSTOM_TARGET(kstarsliteqml SOURCES ${kstarsliteqml_SRCS}) if(ANDROID) add_subdirectory(kstarslite/res) endif(ANDROID) endif(BUILD_KSTARS_LITE) set(kstars_SRCS ${indi_SRCS} ${fits_SRCS} ${ekos_SRCS} ${onlineparser_SRCS} ${libkstarswidgets_SRCS} ${libkstarscomponents_SRCS} ${libkstarstools_SRCS} ${kstars_extra_SRCS} ${kstars_gl_SRCS} ${kstars_projection_SRCS} ${xplanet_SRCS} ${kstars_options_SRCS} ${kstars_skyobjects_SRCS} ${kstars_dialogs_SRCS} ${oal_SRCS} ${printing_SRCS} #KStars Lite ${kstarslite_SRCS} ${indi_lite_SRCS} ) kconfig_add_kcfg_files(kstars_SRCS ${kstars_KCFG_SRCS}) if(NOT BUILD_KSTARS_LITE) qt5_add_dbus_adaptor(kstars_SRCS org.kde.kstars.xml kstars.h KStars) qt5_add_dbus_adaptor(kstars_SRCS org.kde.kstars.SimClock.xml simclock.h SimClock) if (INDI_FOUND) qt5_add_dbus_adaptor(kstars_SRCS org.kde.kstars.INDI.xml indi/indidbus.h INDIDBus) qt5_add_dbus_adaptor(kstars_SRCS org.kde.kstars.Ekos.xml ekos/ekosmanager.h EkosManager) qt5_add_dbus_adaptor(kstars_SRCS org.kde.kstars.Ekos.Capture.xml ekos/capture/capture.h Ekos::Capture) qt5_add_dbus_adaptor(kstars_SRCS org.kde.kstars.Ekos.Focus.xml ekos/focus/focus.h Ekos::Focus) qt5_add_dbus_adaptor(kstars_SRCS org.kde.kstars.Ekos.Guide.xml ekos/guide/guide.h Ekos::Guide) qt5_add_dbus_adaptor(kstars_SRCS org.kde.kstars.Ekos.Align.xml ekos/align/align.h Ekos::Align) qt5_add_dbus_adaptor(kstars_SRCS org.kde.kstars.Ekos.Mount.xml ekos/mount/mount.h Ekos::Mount) qt5_add_dbus_adaptor(kstars_SRCS org.kde.kstars.Ekos.Dome.xml ekos/auxiliary/dome.h Ekos::Dome) qt5_add_dbus_adaptor(kstars_SRCS org.kde.kstars.Ekos.Weather.xml ekos/auxiliary/weather.h Ekos::Weather) qt5_add_dbus_adaptor(kstars_SRCS org.kde.kstars.Ekos.DustCap.xml ekos/auxiliary/dustcap.h Ekos::DustCap) qt5_add_dbus_adaptor(kstars_SRCS org.kde.kstars.Ekos.Scheduler.xml ekos/scheduler/scheduler.h Ekos::Scheduler) endif(INDI_FOUND) ki18n_wrap_ui(kstars_SRCS ${indiui_SRCS} ${ui_SRCS} ${fitsui_SRCS} ${ekosui_SRCS} ${xplanetui_SRCS} ${kstars_optionsui_SRCS} ${kstars_dialogsui_SRCS} ${printingui_SRCS} auxiliary/thumbnailpicker.ui auxiliary/thumbnaileditor.ui oal/observeradd.ui oal/equipmentwriter.ui oal/execute.ui #skycomponents/notifyupdatesui.ui ) endif(NOT BUILD_KSTARS_LITE) add_library(KStarsLib STATIC ${kstars_SRCS}) if(BUILD_KSTARS_LITE) target_link_libraries(KStarsLib LibKSDataHandlers htmesh KF5::I18n KF5::Plotting KF5::ConfigGui Qt5::Gui Qt5::Sql Qt5::Qml Qt5::Quick Qt5::QuickControls2 Qt5::Positioning Qt5::Concurrent ${ZLIB_LIBRARIES} ) if(INDI_FOUND) if(ANDROID) #RAWExtractor is needed for converting RAW photos to JPEG in INDI Lite add_library(RAWExtractor SHARED IMPORTED) include_directories(${BUILD_KSTARSLITE_DIR}/include/libraw) set_property(TARGET RAWExtractor PROPERTY IMPORTED_LOCATION ${BUILD_KSTARSLITE_DIR}/android_libs/${ANDROID_ARCHITECTURE}/libRAWExtractor.so) target_link_libraries(KStarsLib RAWExtractor) endif(ANDROID) endif(INDI_FOUND) else(BUILD_KSTARS_LITE) target_link_libraries(KStarsLib LibKSDataHandlers htmesh KF5::Crash KF5::I18n KF5::NewStuff KF5::KIOFileWidgets KF5::WidgetsAddons KF5::Plotting Qt5::Gui Qt5::PrintSupport Qt5::Sql Qt5::Svg Qt5::Qml Qt5::Quick Qt5::Network Qt5::Concurrent ${ZLIB_LIBRARIES} ) if (KF5NotifyConfig_FOUND) target_link_libraries(KStarsLib KF5::NotifyConfig) endif(KF5NotifyConfig_FOUND) endif(BUILD_KSTARS_LITE) if(NOT WIN32) target_link_libraries(KStarsLib m) endif(NOT WIN32) if (CFITSIO_FOUND) target_link_libraries(KStarsLib ${CFITSIO_LIBRARIES}) endif(CFITSIO_FOUND) if(INDI_FOUND) if(BUILD_KSTARS_LITE) # find_package(Nova REQUIRED) # target_link_libraries(KStarsLib ${CMAKE_THREAD_LIBS_INIT} ${NOVA_LIBRARIES}) target_link_libraries(KStarsLib ${CMAKE_THREAD_LIBS_INIT} ) else(BUILD_KSTARS_LITE) target_link_libraries(KStarsLib ${CMAKE_THREAD_LIBS_INIT} KF5::Notifications) endif(BUILD_KSTARS_LITE) if(WIN32 OR ANDROID) add_definitions(-DUSE_QT5_INDI) find_package(Nova REQUIRED) if(ANDROID) target_link_libraries(KStarsLib ${NOVA_LIBRARIES} ${INDI_CLIENT_ANDROID_LIBRARIES}) else(ANDROID) target_link_libraries(KStarsLib ${NOVA_LIBRARIES} ${INDI_LIBRARIES} ${INDI_CLIENT_QT_LIBRARIES}) endif(ANDROID) else(WIN32 OR ANDROID) # If INDI Qt5 Client is found, use it. # Do not use Qt5 client on Linux for now (But KStars Lite needs it - polaris 31.10.2016) if(BUILD_KSTARS_LITE) add_definitions(-DUSE_QT5_INDI) target_link_libraries(KStarsLib ${INDI_LIBRARIES} ${INDI_CLIENT_QT_LIBRARIES} z) else(BUILD_KSTARS_LITE) target_link_libraries(KStarsLib ${INDI_LIBRARIES} ${INDI_CLIENT_LIBRARIES} z) endif(BUILD_KSTARS_LITE) endif(WIN32 OR ANDROID) endif(INDI_FOUND) if(WCSLIB_FOUND) target_link_libraries(KStarsLib ${WCSLIB_LIBRARIES}) endif (WCSLIB_FOUND) if(LibRaw_FOUND) if(NOT BUILD_KSTARS_LITE) target_link_libraries(KStarsLib ${LibRaw_LIBRARIES}) endif(NOT BUILD_KSTARS_LITE) endif (LibRaw_FOUND) #FIXME Enable OpenGL Later #if( OPENGL_FOUND ) # target_link_libraries(KStarsLib # ${OPENGL_LIBRARIES} # ${QT_QTOPENGL_LIBRARY} # ) #endif( OPENGL_FOUND ) set (KSTARS_APP_SRCS main.cpp ) if(NOT BUILD_KSTARS_LITE) # add icon to application sources ecm_add_app_icon(KSTARS_APP_SRCS ICONS ${CMAKE_CURRENT_SOURCE_DIR}/icons/16-apps-kstars.png ${CMAKE_CURRENT_SOURCE_DIR}/icons/32-apps-kstars.png ${CMAKE_CURRENT_SOURCE_DIR}/icons/48-apps-kstars.png ${CMAKE_CURRENT_SOURCE_DIR}/icons/64-apps-kstars.png ${CMAKE_CURRENT_SOURCE_DIR}/icons/128-apps-kstars.png ) qt5_add_resources(KSTARS_APP_SRCS data/kstars.qrc) endif(NOT BUILD_KSTARS_LITE) add_executable(kstars ${KSTARS_APP_SRCS}) target_link_libraries(kstars KStarsLib) if(NOT BUILD_KSTARS_LITE) install(TARGETS kstars ${KDE_INSTALL_TARGETS_DEFAULT_ARGS}) ########### install files ############### install(PROGRAMS org.kde.kstars.desktop DESTINATION ${KDE_INSTALL_APPDIR}) install(FILES kstars.kcfg DESTINATION ${KDE_INSTALL_KCFGDIR}) install(FILES kstars.notifyrc DESTINATION ${KNOTIFYRC_INSTALL_DIR}) endif(NOT BUILD_KSTARS_LITE) diff --git a/kstars/kstarslite/qml/CMakeLists.txt b/kstars/kstarslite/qml/CMakeLists.txt index f794574c1..69427e0ea 100644 --- a/kstars/kstarslite/qml/CMakeLists.txt +++ b/kstars/kstarslite/qml/CMakeLists.txt @@ -1,67 +1,68 @@ #install_files install( FILES main.qml DESTINATION ${KDE_INSTALL_DATADIR}/kstars/kstarslite/qml ) install( FILES constants/Constants.qml constants/qmldir DESTINATION ${KDE_INSTALL_DATADIR}/kstars/kstarslite/qml/constants ) install( FILES modules/BottomMenu.qml modules/Splash.qml modules/TopMenu.qml modules/KSPage.qml modules/KSTab.qml modules/KSListView.qml modules/SkyMapLiteWrapper.qml modules/TimePage.qml modules/KSLabel.qml + modules/KSTabBarArrow.qml modules/KSTabButton.qml modules/KSText.qml modules/KSTextField.qml modules/KSButton.qml DESTINATION ${KDE_INSTALL_DATADIR}/kstars/kstarslite/qml/modules ) install( FILES dialogs/FindDialog.qml dialogs/LocationDialog.qml dialogs/DetailsDialog.qml DESTINATION ${KDE_INSTALL_DATADIR}/kstars/kstarslite/qml/dialogs ) install( FILES dialogs/helpers/DetailsAddLink.qml dialogs/helpers/LocationEdit.qml dialogs/helpers/DetailsItem.qml dialogs/helpers/LocationLoading.qml DESTINATION ${KDE_INSTALL_DATADIR}/kstars/kstarslite/qml/dialogs/helpers ) install( FILES dialogs/menus/DetailsLinkMenu.qml dialogs/menus/LocationsGeoMenu.qml DESTINATION ${KDE_INSTALL_DATADIR}/kstars/kstarslite/qml/dialogs/menus ) install( FILES modules/popups/ColorSchemePopup.qml modules/popups/ProjectionsPopup.qml modules/popups/FOVPopup.qml DESTINATION ${KDE_INSTALL_DATADIR}/kstars/kstarslite/qml/modules/popups) install ( FILES modules/menus/ContextMenu.qml DESTINATION ${KDE_INSTALL_DATADIR}/kstars/kstarslite/qml/modules/menus) install( FILES modules/helpers/TopMenuButton.qml modules/helpers/BottomMenuButton.qml modules/helpers/TimeSpinBox.qml modules/helpers/PassiveNotification.qml modules/helpers/Units.qml modules/helpers/KSMenuItem.qml modules/helpers/TelescopeControl.qml DESTINATION ${KDE_INSTALL_DATADIR}/kstars/kstarslite/qml/modules/helpers ) install( FILES modules/tutorial/TutorialStep1.qml modules/tutorial/TutorialStep2.qml modules/tutorial/TutorialStep3.qml modules/tutorial/TutorialStep4.qml modules/tutorial/TutorialStep5.qml modules/tutorial/TutorialPopup.qml modules/tutorial/TutorialExitPopup.qml modules/tutorial/TutorialPane.qml DESTINATION ${KDE_INSTALL_DATADIR}/kstars/kstarslite/qml/modules/tutorial ) add_subdirectory(images) add_subdirectory(indi) diff --git a/kstars/kstarslite/qml/constants/Constants.qml b/kstars/kstarslite/qml/constants/Constants.qml index e7b45b024..6fb35916a 100644 --- a/kstars/kstarslite/qml/constants/Constants.qml +++ b/kstars/kstarslite/qml/constants/Constants.qml @@ -1,43 +1,45 @@ // Copyright (C) 2016 Artem Fedoskin /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ pragma Singleton import QtQuick 2.7 import QtQuick.Window 2.2 QtObject { property double dpi: Screen.pixelDensity * 25.4 property double dpmm: Screen.pixelDensity property double dp: dpi < 160 ? 1 : dpi/160 property double pixelRatio: Screen.devicePixelRatio property string density: { if(dpi * pixelRatio <= 120) { return "ldpi" } else if(dpi * pixelRatio <=160) { return "mdpi" } else if(dpi * pixelRatio <= 240) { return "hdpi" } else if(dpi * pixelRatio <= 320) { return "xhdpi" } else if(dpi * pixelRatio <= 480) { return "xxhdpi" } else if(dpi * pixelRatio <=640) { return "xxxhdpi" } } property string iconpath: "../" + "images/" + density + "/icons/" property string imagesPath: "images/" + density + "/" property SystemPalette sysPalette: SystemPalette { } + + property int marginsKStab: 5 * dp //Margins of KSTab content } diff --git a/kstars/kstarslite/qml/dialogs/FindDialog.qml b/kstars/kstarslite/qml/dialogs/FindDialog.qml index 9c3c1c395..0bb2d005a 100644 --- a/kstars/kstarslite/qml/dialogs/FindDialog.qml +++ b/kstars/kstarslite/qml/dialogs/FindDialog.qml @@ -1,122 +1,122 @@ // Copyright (C) 2016 Artem Fedoskin /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ import QtQuick 2.6 import QtQuick.Window 2.2 import QtQuick.Layouts 1.1 import QtQuick.Controls 2.0 import QtQuick.Controls.Material 2.0 import QtQuick.Controls.Universal 2.0 import "../constants" 1.0 import "../modules" KSPage { - contentItem: findColumn title: xi18n("Find an Object") onVisibleChanged: { if(visible) { typeChoose.currentIndex = 0 searchQuery.text = "" } } ColumnLayout { id: findColumn + anchors.fill: parent spacing: 5 * num.dp anchors{ bottom: parent.bottom bottomMargin: 15 * num.dp } RowLayout { anchors { left: parent.left right: parent.right } KSLabel { text: xi18n("Filter by name: ") } KSTextField { id: searchQuery Layout.fillWidth: true onTextChanged: { FindDialogLite.filterList(text) } } } RowLayout { anchors { left: parent.left right: parent.right } KSLabel { text: "Filter by type: " } Item { //Spacer Layout.minimumWidth: 30 * num.dp Layout.fillWidth: true } ComboBox { id: typeChoose model: FindDialogLite.filterModel Layout.fillWidth: true //Init list with objects when everything is loaded Connections { target: window onLoaded: { if(isLoaded) FindDialogLite.filterByType(typeChoose.currentIndex) } } onCurrentIndexChanged: { if(isLoaded) FindDialogLite.filterByType(currentIndex) } } } KSListView { model: SortModel textRole: "name" Layout.fillWidth: true Layout.fillHeight: true onClicked: { stackView.replace(null, initPage) FindDialogLite.selectObject(index) } } RowLayout { KSButton { id: searchInInternet enabled: searchQuery.text.length > 0 && FindDialogLite.isResolveEnabled text: "Search in internet" onClicked: { FindDialogLite.resolveInInternet(searchQuery.text) } } KSButton { text: "Cancel" onClicked: { stackView.pop() } } } } } diff --git a/kstars/kstarslite/qml/dialogs/LocationDialog.qml b/kstars/kstarslite/qml/dialogs/LocationDialog.qml index 119f14105..7a4ebc250 100644 --- a/kstars/kstarslite/qml/dialogs/LocationDialog.qml +++ b/kstars/kstarslite/qml/dialogs/LocationDialog.qml @@ -1,153 +1,152 @@ // Copyright (C) 2016 Artem Fedoskin /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ import QtQuick 2.6 import QtQuick.Window 2.2 import QtQuick.Layouts 1.1 import QtQuick.Controls 2.0 import QtQuick.Controls.Material 2.0 import QtQuick.Controls.Universal 2.0 import "../constants" 1.0 import "../modules" KSPage { - contentItem: locationColumn title: xi18n("Set Geolocation") function filterCities() { LocationDialogLite.filterCity(cityFilter.text, provinceFilter.text, countryFilter.text) } onVisibleChanged: { filterCities() } ColumnLayout { id: locationColumn spacing: 5 * num.dp anchors{ - bottom: parent.bottom + fill: parent bottomMargin: 15 * num.dp } Flow { anchors { left: parent.left right: parent.right } KSLabel { text: xi18n("Current Location: ") } KSLabel { text: LocationDialogLite.currentLocation } } Rectangle { Layout.fillWidth: true height: 1 color: "grey" } GridLayout { Layout.fillWidth: true Layout.fillHeight: true flow: window.isPortrait ? GridLayout.TopToBottom : GridLayout.LeftToRight RowLayout { Layout.fillWidth: true Layout.fillHeight: true KSLabel { text: xi18n("City filter: ") } KSTextField { id: cityFilter Layout.fillWidth: true onTextChanged: { filterCities() } } } RowLayout { Layout.fillWidth: true Layout.fillHeight: true KSLabel { text: xi18n("Province filter: ") } KSTextField { id: provinceFilter Layout.fillWidth: true onTextChanged: { filterCities() } } } RowLayout { Layout.fillWidth: true Layout.fillHeight: true KSLabel { text: xi18n("Country filter: ") } KSTextField { id: countryFilter Layout.fillWidth: true onTextChanged: { filterCities() } } } } KSListView { model: CitiesModel textRole: "display" Layout.fillWidth: true Layout.fillHeight: true checkCurrent: true currentIndex: LocationDialogLite.currLocIndex onClickCheck: false onClicked: { locationsGeoMenu.openMenu(text) } } Button { anchors { bottom: parent.bottom } text: "Add Location" onClicked: { locationEdit.openAdd() } } Button { anchors { bottom: parent.bottom right: parent.right } text: "Set from GPS" onClicked: { locationEdit.setAutomaticallyFromGPS() } } } } diff --git a/kstars/kstarslite/qml/dialogs/helpers/DetailsAddLink.qml b/kstars/kstarslite/qml/dialogs/helpers/DetailsAddLink.qml index 4bc9b8d3b..eaddcbe61 100644 --- a/kstars/kstarslite/qml/dialogs/helpers/DetailsAddLink.qml +++ b/kstars/kstarslite/qml/dialogs/helpers/DetailsAddLink.qml @@ -1,118 +1,119 @@ // Copyright (C) 2016 Artem Fedoskin /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ -import QtQuick.Controls 2.0 +import QtQuick.Controls 2.1 +import QtQuick.Controls 1.4 import QtQuick 2.7 import QtQuick.Layouts 1.1 import "../../constants" 1.0 -import "../../modules" //Import modules +import "../../modules" KSPage { id: addLink title: SkyMapLite.clickedObjectLite.getTranslatedName() + " - " + (editMode ? xi18n("Edit Link") : xi18n("Add a Link") ) property bool editMode: false // true if popup is in edit mode. False if in add mode property bool isImage: false //is the object for which this popup was opened an image or information property int itemIndex: -1 property TextField description: descField property TextField url: urlField function openAdd() { editMode = false stackView.push(this) } function openEdit(index, isImage) { editMode = true if(!isImage) { descField.text = DetailDialogLite.infoTitleList[index] urlField.text = DetailDialogLite.getInfoURL(index) } else { descField.text = DetailDialogLite.imageTitleList[index] urlField.text = DetailDialogLite.getImageURL(index) } itemIndex = index stackView.push(this) } /** closes the page and clears all text fields */ function closeAddLink() { descField.clear() urlField.clear() stackView.pop() } ColumnLayout { anchors { left: parent.left right: parent.right } RowLayout { visible: !editMode RadioButton { checked: true //Set this button to be checked initially id: radioInfo text: xi18n("Information") } RadioButton { id: radioImg text: xi18n("Image") } } KSLabel { text: xi18n("Description") } KSTextField { id: descField Layout.fillWidth: true } KSLabel { text: xi18n("URL") } KSTextField { id: urlField Layout.fillWidth: true } RowLayout { Button { //enabled: text: editMode ? xi18n("Save") : xi18n("Add") onClicked: { if(descField.text == "" || urlField.text == "") { notification.showNotification(xi18n("Please, fill in URL and Description")) return } if(editMode) { DetailDialogLite.editLink(itemIndex, isImage, descField.text, urlField.text) } else { DetailDialogLite.addLink(urlField.text, descField.text, radioImg.checked) } closeAddLink() } } Button { text: xi18n("Cancel") onClicked: { closeAddLink() } } } } } diff --git a/kstars/kstarslite/qml/images/CMakeLists.txt b/kstars/kstarslite/qml/images/CMakeLists.txt index e16c83f1b..57bd4ab65 100644 --- a/kstars/kstarslite/qml/images/CMakeLists.txt +++ b/kstars/kstarslite/qml/images/CMakeLists.txt @@ -1,147 +1,155 @@ install( FILES appointment-new.png appointment-new@2x.png appointment-new@3x.png appointment-new@4x.png arrow-down.png arrow-down@2x.png arrow-down@3x.png arrow-down@4x.png arrow-up.png arrow-up@2x.png arrow-up@3x.png arrow-up@4x.png arrow.png arrow@2x.png arrow@3x.png arrow@4x.png back.png back@2x.png back@3x.png back@4x.png + left-arrow.png + left-arrow@2x.png + left-arrow@3x.png + left-arrow@4x.png + right-arrow.png + right-arrow@2x.png + right-arrow@3x.png + right-arrow@4x.png draw-star.png draw-star@2x.png draw-star@3x.png draw-star@4x.png kstars.png kstars_cbound.png kstars_cbound@2x.png kstars_cbound@3x.png kstars_cbound@4x.png kstars_clines.png kstars_clines@2x.png kstars_clines@3x.png kstars_clines@4x.png kstars_cnames.png kstars_cnames@2x.png kstars_cnames@3x.png kstars_cnames@4x.png kstars_constellationart.png kstars_constellationart@2x.png kstars_constellationart@3x.png kstars_constellationart@4x.png kstars_deepsky.png kstars_deepsky@2x.png kstars_deepsky@3x.png kstars_deepsky@4x.png kstars_ekos.png kstars_ekos@2x.png kstars_ekos@3x.png kstars_ekos@4x.png kstars_fitsviewer.png kstars_fitsviewer@2x.png kstars_fitsviewer@3x.png kstars_fitsviewer@4x.png kstars_grid.png kstars_grid@2x.png kstars_grid@3x.png kstars_grid@4x.png kstars_guides.png kstars_guides@2x.png kstars_guides@3x.png kstars_guides@4x.png kstars_hgrid.png kstars_hgrid@2x.png kstars_hgrid@3x.png kstars_hgrid@4x.png kstars_horizon.png kstars_horizon@2x.png kstars_horizon@3x.png kstars_horizon@4x.png kstars_indi.png kstars_indi@2x.png kstars_indi@3x.png kstars_indi@4x.png kstars_mw.png kstars_mw@2x.png kstars_mw@3x.png kstars_mw@4x.png kstars_planets.png kstars_planets@2x.png kstars_planets@3x.png kstars_planets@4x.png kstars_satellites.png kstars_satellites@2x.png kstars_satellites@3x.png kstars_satellites@4x.png kstars_solarsystem.png kstars_solarsystem@2x.png kstars_solarsystem@3x.png kstars_solarsystem@4x.png kstars_stars.png kstars_stars@2x.png kstars_stars@3x.png kstars_stars@4x.png kstars_supernovae.png kstars_supernovae@2x.png kstars_supernovae@3x.png kstars_supernovae@4x.png media-playback-pause.png media-playback-pause@2x.png media-playback-pause@3x.png media-playback-pause@4x.png media-playback-start.png media-playback-start@2x.png media-playback-start@3x.png media-playback-start@4x.png media-skip-backward.png media-skip-backward@2x.png media-skip-backward@3x.png media-skip-backward@4x.png media-skip-forward.png media-skip-forward@2x.png media-skip-forward@3x.png media-skip-forward@4x.png splash_bg.jpeg splash_bg@2x.jpeg splash_bg@3x.jpeg splash_bg@4x.jpeg splash.png splash@2x.png splash@3x.png splash@4x.png kde-logo.png kde-logo@2x.png kde-logo@3x.png kde-logo@4x.png tutorial-arrow-horizontal.png tutorial-arrow-horizontal@2x.png tutorial-arrow-horizontal@3x.png tutorial-arrow-horizontal@4x.png tutorial-arrow-vertical.png tutorial-arrow-vertical@2x.png tutorial-arrow-vertical@3x.png tutorial-arrow-vertical@4x.png edit-find.png edit-find@2x.png edit-find@3x.png edit-find@4x.png lock-closed.png lock-closed@2x.png lock-closed@3x.png lock-closed@4x.png lock-open.png lock-open@2x.png lock-open@3x.png lock-open@4x.png DESTINATION ${KDE_INSTALL_DATADIR}/kstars/kstarslite/qml/images ) diff --git a/kstars/kstarslite/qml/images/left-arrow.png b/kstars/kstarslite/qml/images/left-arrow.png new file mode 100644 index 000000000..286503a94 Binary files /dev/null and b/kstars/kstarslite/qml/images/left-arrow.png differ diff --git a/kstars/kstarslite/qml/images/left-arrow@2x.png b/kstars/kstarslite/qml/images/left-arrow@2x.png new file mode 100644 index 000000000..d118e4f96 Binary files /dev/null and b/kstars/kstarslite/qml/images/left-arrow@2x.png differ diff --git a/kstars/kstarslite/qml/images/left-arrow@3x.png b/kstars/kstarslite/qml/images/left-arrow@3x.png new file mode 100644 index 000000000..25daef6e9 Binary files /dev/null and b/kstars/kstarslite/qml/images/left-arrow@3x.png differ diff --git a/kstars/kstarslite/qml/images/left-arrow@4x.png b/kstars/kstarslite/qml/images/left-arrow@4x.png new file mode 100644 index 000000000..6c06f9e73 Binary files /dev/null and b/kstars/kstarslite/qml/images/left-arrow@4x.png differ diff --git a/kstars/kstarslite/qml/images/png/128x128/gen2x.sh b/kstars/kstarslite/qml/images/png/128x128/gen2x.sh deleted file mode 100755 index ff98f2910..000000000 --- a/kstars/kstarslite/qml/images/png/128x128/gen2x.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh - -width=128 -halfwidth=$((width/2)) -dir="../../" - -for file in *.png -do - filename="${file%.*}" - /usr/bin/inkscape -z -f "${file}" -w $width -e "${dir}/${filename}.png" - /usr/bin/inkscape -z -f "${file}" -w $(($width + halfwidth*2)) -e "${dir}/${filename}@2x.png" - /usr/bin/inkscape -z -f "${file}" -w $(($width + halfwidth*4)) -e "${dir}/${filename}@3x.png" - /usr/bin/inkscape -z -f "${file}" -w $(($width + halfwidth*6)) -e "${dir}/${filename}@4x.png" -done diff --git a/kstars/kstarslite/qml/images/png/128x128/splash.png b/kstars/kstarslite/qml/images/png/128x128/splash.png deleted file mode 100644 index 6a8fa57bd..000000000 Binary files a/kstars/kstarslite/qml/images/png/128x128/splash.png and /dev/null differ diff --git a/kstars/kstarslite/qml/images/right-arrow.png b/kstars/kstarslite/qml/images/right-arrow.png new file mode 100644 index 000000000..dafd2930a Binary files /dev/null and b/kstars/kstarslite/qml/images/right-arrow.png differ diff --git a/kstars/kstarslite/qml/images/right-arrow@2x.png b/kstars/kstarslite/qml/images/right-arrow@2x.png new file mode 100644 index 000000000..e0923539d Binary files /dev/null and b/kstars/kstarslite/qml/images/right-arrow@2x.png differ diff --git a/kstars/kstarslite/qml/images/right-arrow@3x.png b/kstars/kstarslite/qml/images/right-arrow@3x.png new file mode 100644 index 000000000..71ef6671c Binary files /dev/null and b/kstars/kstarslite/qml/images/right-arrow@3x.png differ diff --git a/kstars/kstarslite/qml/images/right-arrow@4x.png b/kstars/kstarslite/qml/images/right-arrow@4x.png new file mode 100644 index 000000000..7eb75e4bf Binary files /dev/null and b/kstars/kstarslite/qml/images/right-arrow@4x.png differ diff --git a/kstars/kstarslite/qml/indi/DevicePanel.qml b/kstars/kstarslite/qml/indi/DevicePanel.qml index ad7b48150..e81ab692f 100644 --- a/kstars/kstarslite/qml/indi/DevicePanel.qml +++ b/kstars/kstarslite/qml/indi/DevicePanel.qml @@ -1,135 +1,185 @@ // Copyright (C) 2016 Artem Fedoskin /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ -import QtQuick 2.6 +import QtQuick 2.8 import QtQuick.Window 2.2 import "../modules" import "../constants" 1.0 import QtQuick.Layouts 1.2 import QtQuick.Controls 2.0 -import QtQuick.Controls 1.4 KSPage { id: devicesPage title: devicesPage.deviceName + " - " + tabBar.currentItem.text property string deviceName property ImagePreview imagePreview: null ColumnLayout { anchors.fill: parent - TabBar { - id: tabBar - Layout.fillWidth: true + Item { + anchors { + left: parent.left + right: parent.right + } + height: tabBar.height + + KSTabBarArrow { + imgSource: "../images/left-arrow.png" + tabBar: tabBar + state: { + if(!tabBar.contentItem.atXBeginning) { + return "Visible" + } else { + return "Invisible" + } + } + anchors { + left: parent.left + top: parent.top + bottom: parent.bottom + } + } + + KSTabBarArrow { + imgSource: "../images/right-arrow.png" + tabBar: tabBar + state: { + if(!tabBar.contentItem.atXEnd) { + return "Visible" + } else { + return "Invisible" + } + } + anchors { + right: parent.right + top: parent.top + bottom: parent.bottom + } + flickSpeed: -1000 + } - background: Rectangle { - anchors.fill: parent - color: num.sysPalette.base + TabBar { + id: tabBar + Layout.fillHeight: true + anchors { + left: parent.left + right: parent.right + } + clip: true + spacing: 20 + Component.onCompleted: { + contentItem.flickDeceleration = 1000 + } + + background: Rectangle { + color: num.sysPalette.base + } } } SwipeView { id: deviceSwipeView Layout.fillHeight: true Layout.fillWidth: true currentIndex: tabBar.currentIndex clip: true property var groups: [] property var properties: [] property var tabs: [] onCurrentIndexChanged: { tabBar.currentIndex = currentIndex } Connections { target: ClientManagerLite onNewINDIProperty: { if(devicesPage.deviceName === deviceName) { if(deviceSwipeView.groups.indexOf(groupName) == -1) { deviceSwipeView.groups.push(groupName) var newTabComp = Qt.createComponent("../modules/KSTab.qml"); var newTab = newTabComp.createObject(deviceSwipeView) newTab.title = groupName var columnForTab = Qt.createQmlObject('import QtQuick 2.7 import QtQuick.Layouts 1.3 Column { spacing: 5 }', newTab.contentItem) newTab.rootItem = columnForTab var tabButton = Qt.createQmlObject('import QtQuick 2.7; import QtQuick.Controls 2.0 import "../modules" KSTabButton {}', tabBar); tabButton.text = groupName if(tabBar.count == 1) { //Without notifying about adding first item to tabBar title of devicesPage won't be updated tabBar.currentItemChanged() } deviceSwipeView.tabs.push(newTab) if(groupName == "Motion Control") { var component = Qt.createComponent("modules/MotionControl.qml"); var motionControl = component.createObject(newTab) motionControl.deviceName = deviceName } } if(groupName != "Motion Control") { for(var i = 0; i < deviceSwipeView.tabs.length; ++i) { var tab = deviceSwipeView.tabs[i] if(tab.title === groupName) { var propComp = Qt.createComponent("modules/Property.qml"); var property = propComp.createObject(tab.rootItem) property.propName = propName property.label = label property.deviceName = deviceName property.parentTab = tab if(propName == "CCD_EXPOSURE" && devicesPage.imagePreview == null) { var imgPreviewComp = Qt.createComponent("ImagePreview.qml"); devicesPage.imagePreview = imgPreviewComp.createObject(window) devicesPage.imagePreview.deviceName = devicesPage.deviceName } } } } } } onRemoveINDIProperty: { for(var i = 0; i < deviceSwipeView.tabs.length; ++i) { var tab = deviceSwipeView.tabs[i] if(tab.title === groupName && groupName != "Motion Control") { var contentItem = deviceSwipeView.tabs[i].rootItem for(var c = 0; c < contentItem.children.length; ++c) { if(contentItem.children[c].propName === propName) { contentItem.children[c].destroy() } } if(contentItem.children.length == 0) { var groups = deviceSwipeView.groups groups.splice(groups.indexOf(groupName), 1) tab.destroy() } /*if(propName == "CCD_EXPOSURE" && devicesPage.imagePreview != null) { imgPreview.destroy() }*/ } } } } } } } diff --git a/kstars/kstarslite/qml/indi/INDIControlPanel.qml b/kstars/kstarslite/qml/indi/INDIControlPanel.qml index 045a1a644..db018a408 100644 --- a/kstars/kstarslite/qml/indi/INDIControlPanel.qml +++ b/kstars/kstarslite/qml/indi/INDIControlPanel.qml @@ -1,163 +1,162 @@ // Copyright (C) 2016 Artem Fedoskin /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ import QtQuick 2.6 import QtQuick.Window 2.2 import QtQuick.Controls 2.0 import QtQuick.Layouts 1.2 import "../modules" import "../constants" 1.0 KSPage { id: indiPage objectName: "indiControlPanel" title: "INDI Control Panel" property bool connected: ClientManagerLite.connected -// Component.onCompleted: { -// if(Qt.platform.os != "android") { -// ClientManagerLite.setHost("localhost", parseInt(7624)) -// } -// } + Component.onCompleted: { + //Debug purposes + ClientManagerLite.setHost("localhost", 7624) + } onConnectedChanged: { if(!indiPage.connected) { for(var i = 0; i < devicesModel.count; ++i) { devicesModel.get(i).panel.destroy() stackView.pop(indiPage) } devicesModel.clear() notification.showNotification("Disconnected from the server") } } - contentItem: cPanelColumn ColumnLayout { + anchors.fill: parent id: cPanelColumn spacing: 5 * num.dp ColumnLayout { visible: !indiPage.connected anchors { left: parent.left right: parent.right } KSLabel { text: xi18n("INDI Host") } RowLayout { anchors { left: parent.left right: parent.right } KSTextField { id:ipHost placeholderText: xi18n("IP") Layout.alignment: Qt.AlignHCenter Layout.maximumWidth: parent.width*0.8 Layout.fillWidth: true text: ClientManagerLite.lastUsedServer } KSTextField { id:portHost placeholderText: xi18n("Port") Layout.alignment: Qt.AlignHCenter Layout.maximumWidth: parent.width*0.2 Layout.fillWidth: true text: ClientManagerLite.lastUsedPort } } } KSLabel { id: connectedTo visible: indiPage.connected text: xi18n("Connected to ") + ClientManagerLite.connectedHost } Button { text: indiPage.connected ? xi18n("Disconnect") : xi18n("Connect ") onClicked: { if(!indiPage.connected) { if(ClientManagerLite.setHost(ipHost.text, parseInt(portHost.text))) { notification.showNotification(xi18n("Successfully connected to the server")) } else { notification.showNotification(xi18n("Couldn't connect to the server")) } } else { ClientManagerLite.disconnectHost() } Qt.inputMethod.hide() } } ColumnLayout { Layout.fillHeight: true Layout.fillWidth: true visible : indiPage.connected Rectangle { Layout.fillWidth: true height: 1 * num.dp color: "gray" } KSLabel { id: devicesLabel text: xi18n("Available Devices") } ListModel { id: devicesModel } Connections { target: ClientManagerLite onNewINDIDevice: { var component = Qt.createComponent(Qt.resolvedUrl("./DevicePanel.qml")); var devicePanel = component.createObject(window); devicePanel.deviceName = deviceName devicesModel.append({ name: deviceName, panel: devicePanel }) } onRemoveINDIDevice: { for(i = 0; i < devicesModel.count; ++i) { if(devicesModel.get(i).name == deviceName) { devicesModel.panel.destroy() devicesModel.remove(i) } } } onNewINDIMessage: { notification.showNotification(message) } } } KSListView { id: devicesPage Layout.fillHeight: true Layout.fillWidth: true model: devicesModel textRole: "name" onClicked: { stackView.push(devicesModel.get(currentIndex).panel) } } } } diff --git a/kstars/kstarslite/qml/indi/ImagePreview.qml b/kstars/kstarslite/qml/indi/ImagePreview.qml index bf8a013a0..f0d3be978 100644 --- a/kstars/kstarslite/qml/indi/ImagePreview.qml +++ b/kstars/kstarslite/qml/indi/ImagePreview.qml @@ -1,104 +1,104 @@ // Copyright (C) 2016 Artem Fedoskin /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ import QtQuick 2.6 import QtQuick.Window 2.2 import "../modules" import "../constants" 1.0 import QtQuick.Layouts 1.2 import QtQuick.Controls 2.0 import QtQuick.Dialogs 1.2 as Dialogs KSPage { id: imagePreview - contentItem: imgPreviewColumn + anchors.fill: parent title: "Image Preview - " + deviceName property string deviceName property Item buttonRow: null Item { id: imgPreviewColumn anchors.bottom: parent.bottom RowLayout { id: saveButtons anchors { top: parent.top left: parent.left // margins: 10 * num.dp } Layout.fillWidth: true spacing: 5 * num.dp Button { text: "Save As" onClicked: { ClientManagerLite.saveDisplayImage() } } } Image { id: image Layout.fillHeight: true Layout.fillWidth: true fillMode: Image.PreserveAspectFit anchors { top: saveButtons.bottom left: parent.left right: parent.right bottom: parent.bottom margins: 15 * num.dp } } Connections { target: ClientManagerLite onNewINDIBLOBImage: { if(imagePreview.deviceName == deviceName) { image.source = "image://images/ccdPreview" stackView.push(imagePreview) } } onCreateINDIButton: { if(imagePreview.deviceName == deviceName) { if(propName == "UPLOAD_MODE") { if(imagePreview.buttonRow == null) { var buttonRowComp = Qt.createComponent("modules/KSButtonsSwitchRow.qml"); imagePreview.buttonRow = buttonRowComp.createObject(saveButtons) imagePreview.buttonRow.deviceName = deviceName imagePreview.buttonRow.propName = propName imagePreview.buttonRow.exclusive = exclusive } imagePreview.buttonRow.addButton(propText, switchName, checked, enabled) } } } onRemoveINDIProperty: { if(imagePreview.deviceName == deviceName) { if(propName == "UPLOAD_MODE") { if(imagePreview.buttonRow != null) { imagePreview.buttonRow.destroy() imagePreview.buttonRow = null } } } } } } } diff --git a/kstars/kstarslite/qml/indi/modules/MotionControl.qml b/kstars/kstarslite/qml/indi/modules/MotionControl.qml index 63b7adea7..92d40eeab 100644 --- a/kstars/kstarslite/qml/indi/modules/MotionControl.qml +++ b/kstars/kstarslite/qml/indi/modules/MotionControl.qml @@ -1,309 +1,308 @@ // Copyright (C) 2016 Artem Fedoskin /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ import QtQuick 2.6 import QtQuick.Window 2.2 import QtQuick.Layouts 1.2 import QtQuick.Controls 2.0 import TelescopeLiteEnums 1.0 import "../../constants" 1.0 import "../../modules" ColumnLayout { id: motionCColumn anchors { fill: parent - topMargin: 5 * num.dp - bottomMargin: 5 * num.dp + margins: num.marginsKStab } spacing: 5 * num.dp enabled: buttonsEnabled property string deviceName property var telescope: ClientManagerLite.getTelescope(deviceName) property bool buttonsEnabled: telescope.isConnected() Connections { target: ClientManagerLite onDeviceConnected: { if(motionCColumn.deviceName == deviceName) { buttonsEnabled = isConnected } } onTelescopeAdded: { if(newTelescope.getDeviceName() === motionCColumn.deviceName) { telescope = newTelescope } } } //Row 1 RowLayout { Layout.fillHeight: true anchors { left: parent.left right: parent.right } Button { Layout.fillHeight: true Layout.fillWidth: true activeFocusOnTab: false onPressedChanged: { if(telescope) { if(pressed) { telescope.moveNS(TelescopeNS.MOTION_NORTH, TelescopeCommand.MOTION_START) telescope.moveWE(TelescopeNS.MOTION_WEST, TelescopeCommand.MOTION_START) } else { telescope.moveNS(TelescopeNS.MOTION_NORTH, TelescopeCommand.MOTION_STOP) telescope.moveWE(TelescopeNS.MOTION_WEST, TelescopeCommand.MOTION_STOP) } } } text: xi18n("NW") } Button { Layout.fillHeight: true Layout.fillWidth: true activeFocusOnTab: false onPressedChanged: { if(telescope) { if(pressed) { telescope.moveNS(TelescopeNS.MOTION_NORTH, TelescopeCommand.MOTION_START) } else { telescope.moveNS(TelescopeNS.MOTION_NORTH, TelescopeCommand.MOTION_STOP) } } } text: xi18n("N") } Button { Layout.fillHeight: true Layout.fillWidth: true activeFocusOnTab: false onPressedChanged: { if(telescope) { if(pressed) { telescope.moveNS(TelescopeNS.MOTION_NORTH, TelescopeCommand.MOTION_START) telescope.moveWE(TelescopeNS.MOTION_EAST, TelescopeCommand.MOTION_START) } else { telescope.moveNS(TelescopeNS.MOTION_NORTH, TelescopeCommand.MOTION_STOP) telescope.moveWE(TelescopeNS.MOTION_EAST, TelescopeCommand.MOTION_STOP) } } } text: xi18n("NE") } } //Row 2 RowLayout { Layout.fillHeight: true Layout.fillWidth: true Button { Layout.fillHeight: true Layout.fillWidth: true activeFocusOnTab: false onPressedChanged: { if(telescope) { if(pressed) { telescope.moveWE(TelescopeNS.MOTION_WEST, TelescopeCommand.MOTION_START) } else { telescope.moveWE(TelescopeNS.MOTION_WEST, TelescopeCommand.MOTION_STOP) } } } text: xi18n("W") } Button { Layout.fillHeight: true Layout.fillWidth: true activeFocusOnTab: false onPressedChanged: { if(telescope) { telescope.abort(); } } text: xi18n("Stop") } Button { Layout.fillHeight: true Layout.fillWidth: true activeFocusOnTab: false onPressedChanged: { if(telescope) { if(pressed) { telescope.moveWE(TelescopeNS.MOTION_EAST, TelescopeCommand.MOTION_START) } else { telescope.moveWE(TelescopeNS.MOTION_EAST, TelescopeCommand.MOTION_STOP) } } } text: xi18n("E") } } //Row 3 RowLayout { Layout.fillHeight: true Layout.fillWidth: true Button { Layout.fillHeight: true Layout.fillWidth: true activeFocusOnTab: false onPressedChanged: { if(telescope) { if(pressed) { telescope.moveNS(TelescopeNS.MOTION_SOUTH, TelescopeCommand.MOTION_START) telescope.moveWE(TelescopeNS.MOTION_WEST, TelescopeCommand.MOTION_START) } else { telescope.moveNS(TelescopeNS.MOTION_SOUTH, TelescopeCommand.MOTION_STOP) telescope.moveWE(TelescopeNS.MOTION_WEST, TelescopeCommand.MOTION_STOP) } } } text: xi18n("SW") } Button { Layout.fillHeight: true Layout.fillWidth: true activeFocusOnTab: false text: xi18n("S") onPressedChanged: { if(telescope) { if(pressed) { telescope.moveNS(TelescopeNS.MOTION_SOUTH, TelescopeCommand.MOTION_START) } else { telescope.moveNS(TelescopeNS.MOTION_SOUTH, TelescopeCommand.MOTION_STOP) } } } } Button { Layout.fillHeight: true Layout.fillWidth: true activeFocusOnTab: false onPressedChanged: { if(telescope) { if(pressed) { telescope.moveNS(TelescopeNS.MOTION_SOUTH, TelescopeCommand.MOTION_START) telescope.moveWE(TelescopeNS.MOTION_EAST, TelescopeCommand.MOTION_START) } else { telescope.moveNS(TelescopeNS.MOTION_SOUTH, TelescopeCommand.MOTION_STOP) telescope.moveWE(TelescopeNS.MOTION_EAST, TelescopeCommand.MOTION_STOP) } } } text: xi18n("SE") } } //Slewing RowLayout { id: slewingRateRow Layout.fillHeight: true Layout.fillWidth: true Button { id: decreaseSlew height: motionCColumn.height * 0.15 Layout.fillWidth: true activeFocusOnTab: false enabled: telescope.slewDecreasable Connections { target: telescope onSlewDecreasableChanged: { decreaseSlew.enabled = telescope.slewDecreasable } } onClicked: { if(telescope) { telescope.decreaseSlewRate() } } text: xi18n("-") } KSText { height: parent.height * 0.15 Layout.fillWidth: true horizontalAlignment: Text.AlignHCenter text: xi18n("Slew rate: " + telescope.slewRateLabel) } Button { id: increaseSlew height: motionCColumn.height * 0.15 Layout.fillWidth: true activeFocusOnTab: false enabled: telescope.slewIncreasable Connections { target: telescope onSlewIncreasableChanged: { increaseSlew.enabled = telescope.slewIncreasable } } onClicked: { if(telescope) { telescope.increaseSlewRate() } } text: xi18n("+") } } } diff --git a/kstars/kstarslite/qml/modules/KSPage.qml b/kstars/kstarslite/qml/modules/KSPage.qml index f7bd9899c..ad50eabe7 100644 --- a/kstars/kstarslite/qml/modules/KSPage.qml +++ b/kstars/kstarslite/qml/modules/KSPage.qml @@ -1,27 +1,27 @@ // Copyright (C) 2016 Artem Fedoskin /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ import QtQuick 2.6 import QtQuick.Layouts 1.1 -import QtQuick.Controls 2.0 +import QtQuick.Controls 2.1 import QtQuick.Controls.Material 2.0 import QtQuick.Controls.Universal 2.0 import "../constants" 1.0 Pane { property string title: "" visible: false background: Rectangle { - anchors.fill: parent +// anchors.fill: parent color: num.sysPalette.base } } diff --git a/kstars/kstarslite/qml/modules/KSTab.qml b/kstars/kstarslite/qml/modules/KSTab.qml index 11e4b960f..e706cd43b 100644 --- a/kstars/kstarslite/qml/modules/KSTab.qml +++ b/kstars/kstarslite/qml/modules/KSTab.qml @@ -1,43 +1,46 @@ // Copyright (C) 2016 Artem Fedoskin /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ import QtQuick 2.6 import QtQuick.Layouts 1.2 import QtQuick.Controls 2.0 import "../constants" 1.0 Pane { id: tab property string title: "" clip: true property Item flickableItem: flickable padding: 0 background: Rectangle { color: num.sysPalette.base } //contentItem is already used by Pane so be it rootItem property Item rootItem onRootItemChanged: { if(rootItem.parent != flickable.contentItem) rootItem.parent = flickable.contentItem } Flickable { id: flickable - anchors.fill: parent + anchors{ + fill: parent + margins: num.marginsKStab + } ScrollBar.vertical: ScrollBar { id: scrollBar } flickableDirection: Flickable.VerticalFlick contentWidth: rootItem != undefined ? rootItem.width : 0 contentHeight: rootItem != undefined ? rootItem.height : 0 flickableChildren: rootItem } } diff --git a/kstars/kstarslite/qml/modules/KSTabBarArrow.qml b/kstars/kstarslite/qml/modules/KSTabBarArrow.qml new file mode 100644 index 000000000..a9caa6ca5 --- /dev/null +++ b/kstars/kstarslite/qml/modules/KSTabBarArrow.qml @@ -0,0 +1,99 @@ +// Copyright (C) 2016 Artem Fedoskin +/*************************************************************************** +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +* * +***************************************************************************/ + +import QtQuick 2.6 +import QtQuick.Layouts 1.2 +import QtQuick.Controls 2.0 +import "../constants" 1.0 + +Button { + z: 1 + id: arrow + property string imgSource + property Item tabBar + property int flickSpeed: 1000 + state: "Invisible" + + width:image.width*1.5 + Image { + id: image + opacity: 0.6 + anchors{ + verticalCenter: parent.verticalCenter + horizontalCenter: parent.horizontalCenter + } + source: imgSource + } + + background: Rectangle { + color: "grey" + opacity: 0.6 + } + + onPressedChanged: { + if(pressed) { + arrow.background.opacity = 0.3 + tabBar.contentItem.flick(flickSpeed,0) + } else { + arrow.background.opacity = 0.6 + } + } + + states: [ + State { + name: "Visible" + PropertyChanges{target: arrow; opacity: 1.0} + PropertyChanges{target: arrow; visible: true} + }, + State { + name:"Invisible" + PropertyChanges{target: arrow; opacity: 0.0} + PropertyChanges{target: arrow; visible: false} + } + ] + + transitions: [ + Transition { + from: "Visible" + to: "Invisible" + + SequentialAnimation{ + NumberAnimation { + target: arrow + property: "opacity" + duration: arrow + easing.type: Easing.InOutQuad + } + NumberAnimation { + target: arrow + property: "visible" + duration: 50 + } + } + }, + Transition { + from: "Invisible" + to: "Visible" + SequentialAnimation{ + NumberAnimation { + target: arrow + property: "visible" + duration: 0 + } + NumberAnimation { + target: arrow + property: "opacity" + duration: 200 + easing.type: Easing.InOutQuad + } + } + } + ] +} diff --git a/kstars/kstarslite/qml/modules/KSTabButton.qml b/kstars/kstarslite/qml/modules/KSTabButton.qml index f311b5293..268ac6290 100644 --- a/kstars/kstarslite/qml/modules/KSTabButton.qml +++ b/kstars/kstarslite/qml/modules/KSTabButton.qml @@ -1,15 +1,18 @@ import QtQuick 2.6 import QtQuick.Controls 2.0 import "../constants/" 1.0 +import QtQuick.Layouts 1.2 TabButton { id: tabButton + width: contentItem.contentWidth//tabText.text.length * tabText.font.pixelSize + contentItem: KSText { + id: tabText text: tabButton.text font: tabButton.font opacity: enabled ? 1.0 : 0.3 horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignVCenter - elide: Text.ElideRight } }